wordpress add tags to custom post type

WordPress tutorial, wordpress add tags to custom post type. we can create the custom post type. In this tutorial I will show you to add category and tags.

wordpress add tags to custom post type

wordpress add tags to custom post type
wordpress add tags to custom post type

 

You just need use the following code in your arguments.

'taxonomies' => array('category', 'post_tag') // this is IMPORTANT

Here is full code which is I used in functions.php file

add_action('init', 'wordpress_themes');
 function wordpress_themes() {
 $wp_themes_args = array(
 'label' => __('Wordpress Themes'),
 'singular_label' => __('Wordpress Themes'),
 'public' => true,
 'show_ui' => true,
 'capability_type' => 'post',
 'hierarchical' => false,         
 'rewrite' => true,
  'supports' => array('title','editor','author','thumbnail','excerpt','comments'),
           'taxonomies' => array('category', 'post_tag') // this is IMPORTANT

 );
 register_post_type('wordpress-themes',$wp_themes_args);
 }

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

2 thoughts on “wordpress add tags to custom post type”

  1. WordPress tags support is so much important for SEO. Really helpful article. Learn new thing about custom post type and wordpress tags.

Leave a Reply

Your email address will not be published.