WordPress
October 15, 2021

Adding Custom Meta Fields to Taxonomies in WordPress

For add Custom Meta Field in taxonomy use following code in your current themes functions.php file.


term_id;

// retrieve the existing value(s) for this meta field. This returns an array
$term_meta = get_term_meta( $term_id, ‘custom_term_meta’, true ); ?>

    term_id, ‘custom_term_meta’, true);
    if(!empty($custom_term_meta)) { ?>


Related Post


How to Create Your Own WordPress Shortcodes

Simple shortcodes Shortcode functions can be added to plugin code or your theme’s functions.php file. If it’s the latter, I’d recommend creating a separate wc-shortcodes.php file, then adding include(‘wc-shortcodes.php’); to functions.php. You can use below code to include file wc-shortcodes.php. If the shortcode produces a lot of HTML then ob_start can be used to capture […]

How to Load More Post With Ajax in WordPress

Create a load more button to show additional posts or custom post types using AJAX following code in your current theme. 1. Set load more button in your post loop and pass paged parameter in post argument. Load More This will display two post per page. 2. Then you have to add the following code […]

Get product details from $product object WooCommerce

I am publish this article for get values from WooCommerce $product object. You can get all information of product from $product object. When we have $product object. Get $product object by $product_id. Get $order object by $order_id. Get products from $cart object.

How to create custom widgets in wordpress

Include the following code file to your current themes functions.php file Here is the code for sidebar register.

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

How To Create Meta Boxes in WordPress

A meta box is a draggable box displayed in the post editing screen in the backend of WordPress. Users can select or enter extra information in meta boxes addition to the content in the main post editing area. There are two types of data you can enter in meta boxes: metadata (i.e. custom fields), and […]


Leave a Reply

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