Display term (Category, Tag…) as output

With Content Views Pro, you can display terms as output easily (view demo).

You can do it easily with simple steps below:

  • In Filter Settings tab, select the “All/Multi post types” option for Content Type setting:
    CVP - select all post types
  • In Filter Settings tab, Advance section, select the Taxonomy (Categories, Tags…) checkbox.
  • Select the taxonomy and terms to display.
    For example: in below screenshot, we select the “Category” taxonomy and three terms Food, Business, Life.
  • Select the Show terms as output option of “Output Modification” setting.

    Content Views Pro - show category as output

You can adjust style (color, font…) of terms in Style Settings >> Taxonomy As Output without writing CSS.

# Display term’s image:

  • Install this plugin Taxonomy Thumbnail
    (Adding an image to term is not possible by WordPress, so we need to install an additional plugin. Above plugin is lightweight and it works well, so we recommend it to you)
  • Select thumbnail image for each category/tag/term in its editing page

    CVP - add image to WordPress category

  • Select Show Thumbnail checkbox in Display Settings >> Fields Settings of the View

If you are showing WooCommerce categories, you do NOT need to install plugin “Taxonomy Thumbnail”.

If you already used ACF field as term image, you do NOT need to install plugin “Taxonomy Thumbnail”.
Please add this code to file functions.php in the theme’s folder:

// Content Views Pro - get term image from ACF
add_filter( 'pt_cv_term_thumbnail', 'cvp_theme_term_thumbnail_acf', 100, 2 );
function cvp_theme_term_thumbnail_acf( $thumb, $term ) {
	$field	 = get_field( 'ACF_FIELD_HERE', $term );
	$thumb	 = '<img src="' . $field[ 'url' ] . '" />';
	return $thumb;
}

(replace ACF_FIELD_HERE with name of the field)

Thank you,