Display term (Category, Tag…) as output

With Content Views Pro, you can display terms (categories, tags, custom taxonomy) 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.

    You can leave the “Select Terms” empty to display ALL available terms without manually selecting all of them.

  • 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:

  1. Select Show Thumbnail checkbox in Display Settings >> Fields Settings of the View.
  2. Select thumbnail image for each category/tag/term in its editing page:

    CVP - add image to WordPress category

# Notice:

If you are using Content Views Pro version 5.4.1 and earlier, adding image to term is not possible yet.
We recommend you to install the Advanced Custom Fields (ACF) plugin to add image field to term.
Then 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 image field you created)

Thank you,