WordPress
December 3, 2020

How to Create Custom Taxonomies in WordPress

Custom Taxonomies are same like categories and tags. WordPress allows developers to create Custom Taxonomies. Custom Taxonomies are useful when one wants to create distinct naming systems and make them accessible behind the scenes in a predictable way.

Create Custom Taxonomies by code.

Add below Code in function.php file of your active child theme (or active theme).

1. Creating a Hierarchical Taxonomy
First we create hierarchical taxonomy that works like categories and can have parent and child terms. Add the following code in your theme’s functions.php file or in a site-specific plugin (recommended) to create a hierarchical custom taxonomy like categories:

2. Creating a Non-hierarchical Taxonomy
Create a non-hierarchical custom taxonomy like Tags, add this code in your theme’s functions.php or in a site-specific plugin:

Resource


Related Post


Add Recaptcha in Custom Form in WordPress

You have to add recaptcha external js so use following function in your current themes functions.php file Set Recaptcha element in your form. //Custom Form Name: Put below js in your current themes custom.js file. //Captcha validation script jQuery(document).ready(function($) { $(document).on(‘submit’,’.wc-captcha-form’,function(e){ if(grecaptcha.getResponse() == “”) { e.preventDefault(); $(‘.captcha-error’).text(“Please verify captcha”); } else { $(‘.captcha-error’).text(“”); } }); […]

WordPress Login Form Without Plugin

Are you need simple login form without plugin for your WordPress website? Yes, Then i have created [wc_login_form] shortcode with quick simple code. So you can put login form anywhere like in Pages, Posts and Widget etc… Therefore you just need to put [wc_login_form] shortcode where you need login form. So you need to follow […]

Mobile Menu Collapse Effect Divi

Right Now Divi is not providing collapse effect for mobile menu. So when we have many items its hard to manage menu on mobile. It’s a great way to customize the Divi mobile menu using CSS and jQuery. You have to put following code on your css and js files. Put below code on any […]

Disable Payments on WooCommerce

You are using WooCommerce for your eCommerce website. A thing is you want to disable payment on your website, but disabling in WooCommerce payment setting WooCommerce > Settings > Payments will not work and display There are no payment methods available. Add this code to functions.php file of theme.

Delete Old Post in WordPress

We want to delete old post in easy way, Add the following code to your current themes functions.php file and reload your page and see your post may have been deleted.

Create Custom Template for Child Categories in WordPress

Create different template only for child category put following code in your current themes functions.php file


Leave a Reply

Your email address will not be published. Required fields are marked *