In wordpress add tags and categories to custom post type

Many times we use the custom post type in wordpress. Wordpres tutorial, In wordpress add tags and categories to custom post type.  Some times we need to category and tags for custom post type which associated.

In wordpress add tags and categories to custom post type

you can use the following code in functions.php file.

// === CUSTOM POST TYPES === //
function create_my_post_types() {
	register_post_type( 'Services',
		array(
			'labels' => array(
				'name' => __( 'Services' ),
				'singular_name' => __( 'Services' ),
				'add_new_item' => 'Add New Services',
				'edit_item' => 'Edit Services',
				'new_item' => 'New Services',
				'search_items' => 'Search Services',
				'not_found' => 'No Services found',
				'not_found_in_trash' => 'No Services found in trash',
			),
			'_builtin' => false,
			'public' => true,
			'hierarchical' => false,
			'taxonomies' => array( 'website_type', 'service'),
			'supports' => array(
				'title',
				'editor',
				'excerpt',
                                'thumbnail'
			),
			'rewrite' => array( 'slug' => 'services', 'with_front' => false ),

		)
	);
}
add_action( 'init', 'create_my_post_types' );

// === CUSTOM TAXONOMIES === //
function my_custom_taxonomies() {
	register_taxonomy(
		'website_type',		// internal name = machine-readable taxonomy name
		'Services',		// object type = post, page, link, or custom post-type
		array(
			'hierarchical' => true,
			'label' => 'Website Types',	// the human-readable taxonomy name
			'query_var' => true,	// enable taxonomy-specific querying
			'rewrite' => array( 'slug' => 'website_type' ),	// pretty permalinks for your taxonomy?
		)
	);
	register_taxonomy(
		'service',
		'post',
		array(
			'hierarchical' => false,
			'label' => 'Service',
			'query_var' => true,
			'rewrite' => array( 'slug' => 'service' ),
		)
	);

}
add_action('init', 'my_custom_taxonomies', 0);

Please consult with your developer.

In wordpress add tags and categories to custom post type
In wordpress add tags and categories to custom post type

 

……………………..

Show selected tags in wordpress using Selective Tag Cloud Widget plugin

Some time people want to show Show selected tags in wordpress from all site. Through selective Tags plugin, you can select the post tags which you want to show. We are very happy to launch the new wordpress plugin called Selective Tags.

How to install Selective Tag Cloud Widget?

Follow the usual routine;

  1. Open WP admin – Plugins – Add New
  2. Enter “Selective Tag Cloud Widget” under search and hit Enter
  3. Plugin will show up as the first on the list, click “Install Now”

Or if needed, upload manually. Follow the steps below to install the plugin.

  1. Upload the Selective Tag Cloud Widget directory to the /wp-content/plugins/directory
  2. Activate the plugin through the ‘Plugins’ menu in wp
  3. Go to “Selective Tag Cloud Widget” option to configure the button

Show selected tags in wordpress using selective Tags plugin

Some time people want to show the only selective tags from all site. Through this widget you can select the post tags which you want to show on your site.

More information about Plugin as follows:

Selective Tag WordPress Plugin, provides sidebar widgets which can be used to display tags in the sidebar.

Selective Tag

Sidebar Widget

Selective Tag WordPress Plugin, provides sidebar widgets which can be used to display tags in the sidebar. You can have multiple widgets with different set of tags configured for each one of them.

Each widget allows you to choose

  • The set of tags displayed which is selected by admin
  • Admin can select tag to show in sidebar. Auto complete Text box for Tags.
  • When try to type tags, It will suggest you the used tags from wordpress site.
You can download the plugin from following location.

Screenshot

Show selected tags in wordpress using selective Tags plugin
Show selected tags in wordpress using selective Tags plugin

how to add tag cloud to wordpress theme

WordPress tags and tag cloud is important part in wordpress theme. Here in article given code to add tag cloud to wordpress theme. Tag cloud good for SEO.

I will give so much credit to tags and tag cloud because SEO prospective tag are important.

how to add tag cloud to wordpress theme

What is a tags and Tag cloud?

This is the process of adding keywords which link directly to a site that monitors and allows search of key tags to find information on websites and blogs.

Tag cloud are also same but that will attract the users and give more information about topics which write in your blog. Keep this in mind tag are really important for SEO.

In this article I will show how to create the beautiful tag using wordpress api.

In your template you will found the single.php and page.php or index.php files in that file, You are already using some loop for fetching the posts. In that loop just put following code for displaying the tags.


the_tags( $before, $separator, $after );

<php the_tags();?>

Now comes interesting part,  adding a tag cloud to your sidebar or footer.

Using following code you can display the tag could but don’t put following code in any loop.


<!--?php wp_tag_cloud('smallest=8&largest=22'); ?-->

If you want to show tag cloud more interesting than use my code in your style.css file.


.tags{
 clear:both;
 background:#FAFAFA bottom;
 margin:10px 0 10px;
 padding:12px 10px 15px 10px;
 -moz-box-shadow:0 2px 2px rgba(0, 0, 0, 0.2);
 width:auto;
 margin-bottom:5px;
 width:304px;
 border:1px solid #cfdcc7;
}

.tags a:link,.entry a:visited {
 font-weight:normal;
 color:#356BB2;
}
.tags a:hover {
 background:#356BB2;
 color:#fff;
 font-weight:normal;
 text-decoration:none;
}

Your tag cloud will look like..as follows.

how to add tag cloud to wordpress theme
how to add tag cloud to wordpress theme

you can pass following param to tag_cloud function.


More help full function tag related as follows:

the_tags, tag_description, single_tag_title, wp_tag_cloud, wp_generate_tag_cloud, get_tags, get_the_tags, get_the_tag_list, get_tag_link

You can visit the pages and check the details.