Try below code in your funcions.php to add tags to portfolio post type in The7.2 theme.
add_action( 'init', 'add_tags_portfolio', 0 ); function add_tags_portfolio() { $labels = array( 'name' => _x( 'Tags', 'taxonomy general name' ), 'singular_name' => _x( 'Tag', 'taxonomy singular name' ), 'search_items' => __( 'Search Tags' ), 'popular_items' => __( 'Popular Tags' ), 'all_items' => __( 'All Tags' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Tag' ), 'update_item' => __( 'Update Tag' ), 'add_new_item' => __( 'Add New Tag' ), 'new_item_name' => __( 'New Tag Name' ), 'separate_items_with_commas' => __( 'Separate tags with commas' ), 'add_or_remove_items' => __( 'Add or remove tags' ), 'choose_from_most_used' => __( 'Choose from the most used tags' ), 'menu_name' => __( 'Tags' ), ); register_taxonomy('portfolio-tags','dt_portfolio',array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'portfolio-tags' ), )); } function add_portfolio_tags_after_post($content){ if (is_single() && 'dt_portfolio' == get_post_type() ) { $tags = get_the_term_list( get_the_ID(), 'portfolio-tags', '', '', ''); $content .= '<div class="entry-tags">'.$tags.'</div>'; } return $content; } add_filter( "the_content", "add_portfolio_tags_after_post" );
You may need to reset permalinks after adding the code.
Hi, this worked perfectly, however I can’t get the titles to show on the archive pages e.g.
http://totalpackage.lydiarosedesign.co.uk/venues/great-fosters
Hi,
If you still need any help with it, please submit a ticket here
https://support.dream-theme.com