+923465009310 info@designinggeeks.com
How to Add Tags option to Custom Post Type

If you need to add tags option for custom post types, follow these steps in WordPress to add/allow “Tags” to your custom post types. Add below code to your theme functions.php


add_action( 'init', 'gp_register_taxonomy_for_object_type' );
function gp_register_taxonomy_for_object_type() {
register_taxonomy_for_object_type( 'post_tag', 'projects' );
};

Note :: replace “projects” with your custom post type name.

If you wanted to make a shortcode to show the tags:

function sc_taglist(){
return get_the_tag_list();
}
add_shortcode('tags', 'sc_taglist');

And use

[tags]

shortcode to display tags list anywhere you want.