5 Growing Channels to Boost Traffic to Your WordPress Site

Featured Imgs 26

5 Growing Channels to Boost Traffic to Your WordPress SiteWith everyone sticking to email, Facebook, LinkedIn, Twitter and Instagram, you may start to feel like these channels are getting overcrowded. To change your results, sometimes you need to do something different. If you use a channel that’s popular but new, you may have a higher chance of success. Below are five relatively new channels […]

The post 5 Growing Channels to Boost Traffic to Your WordPress Site appeared first on WPExplorer.

Tips to Create High Converting Forms with WordPress

Featured Imgs 26

Tips to Create High Converting Forms with WordPressIf you’re not using various types of web forms on your WordPress site, then you are missing out on many advantages: engagement, security, and higher conversion rates. Whether you are the owner of an e-commerce site, a blog or a business site, online forms are extremely important. They provide a two-way communication between you and […]

The post Tips to Create High Converting Forms with WordPress appeared first on WPExplorer.

How to Check if Post has Taxonomy Term

Category Image 036

Something I did not know about when working with Custom Post Types and Custom Taxonomies. Normally when checking if a regular WP Post belongs to a specific category, we can use the WordPress function in_category(). But that does not work with Custom Post Types. To check if a CPT belongs to a specific term in a Custom Taxonomy, use has_term() instead.

Check if WP Post belongs to specific category

To check if the current post belongs to a specific category, use in_category(). For example in your theme's single.php template, you can do this:

if (in_category(1)) {
	
	// post is in category with ID = 1
	
}

Here we are checking if the post belongs to category with ID = 1. You can change that to any category ID, name or slug, or an array containing multiple values.

Here is an example where mutliple categories are checked:

if (in_category('donuts')) {
	
	// post belongs to "donuts" category
	
} elseif (in_category(array('coffee', 'beer'))) {
	
	// post belongs to either "coffee" or "beer"
	
} else {
	
	// post does not belong to any of the above categories
	
}

Notice the use of an array in the elseif condition. You can specify as many categories as needed using an array of category IDs, names, or slugs.

Check if CPT belongs to specific taxonomy term

Now for the main point of this tutorial. To check if the current post belongs to a specific term in a custom taxonomy. For example, if we have a taxonomy named download_category and want to check if the current post belongs to the term combo, we can do this:

if (has_term('combo', 'download_category')) {
	
	// post belongs to "combo" in "download_category" taxonomy
	
}

When calling has_term(), the first parameter is the name of the term, and the second parameter is the name of the taxonomy.

To check multiple terms, use an array of term IDs, names, or slugs. For example:

if (has_term(array('combo', 'book', 'deal'), 'download_category')) {
	
	// post belongs to "combo", "book", or "deal" in "download_category" taxonomy
	
}

So this example will check if the current post belongs to "combo", "book", or "deal" in the "download_category" taxonomy.

Bonus Tip: Check for *any* taxonomy term

To check if the current post belongs to any term in a given taxonomy, simply leave the first parameter empty/blank. Example:

if (has_term('', 'download_category')) {
	
	// post belongs to a term in the "download_category" taxonomy
	
}

Here we are checking if the current post belongs to any term in the "download_category" taxonomy.

That's the thick and thin of it.

Bottom line is just remember:

  • Check post for category — use in_category()
  • Check post for tax term — use has_term()

How to Start a WordPress Business

Featured Imgs 26

How To Start A WordPress Based BusinessIs it possible to build a successful business around WordPress today? The short answer is yes. In 2020 there are millions of freelancers earning a living online – and many of them have businesses they created around WordPress. There are solid reasons for this: WordPress continues to grow as a simple and versatile publishing platform […]

The post How to Start a WordPress Business appeared first on WPExplorer.

3 Conversion Optimization Tips To Boost Your eLearning Product’s Sales

Featured Imgs 26

Making more sales is one common goal that all eLearning businesses in the world share. Obviously, who would say no to more money? But are we all making the most out of our marketing campaigns? Are we really selling to our best potentials? We believe there’s scope for betterment, and so we should cash it […]

The post 3 Conversion Optimization Tips To Boost Your eLearning Product’s Sales appeared first on WPArena.

How to Password Protect Downloads with WordPress

Featured Imgs 26

How to Password Protect Downloads with WordPressDownloadable items including e-books, how-to guides, checklist, or even training videos serve a key role in almost all websites. You can sell digital products directly on WordPress or offer these files as free giveaways to engage visitors and increase your email subscriber list. Due to the rise of digital piracy, it’s necessary to pay more […]

The post How to Password Protect Downloads with WordPress appeared first on WPExplorer.

Simple WooCommerce Tips to Make Your Store Even Better

Featured Imgs 26

These days starting your own online store doesn’t have to be just a dream. Thanks to WordPress anyone can build an online store with WooCommerce. It’s quick, fairly easy and you can set up a professional looking website to sell your products without spending a ton of money. What’s more, with these simple WooCommerce tips […]

The post Simple WooCommerce Tips to Make Your Store Even Better appeared first on WPExplorer.