Display term (Category, Tag…) as output

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

  1. If you are showing WooCommerce categories, please skip this step.
    Otherwise, adding an image to term is not possible by WordPress, so we need to install an additional plugin. We recommend you to use the Advanced Custom Fields (ACF) plugin to add image field to term.
    Then 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)

  2. Select thumbnail image for each category/tag/term in its editing page

    CVP - add image to WordPress category

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

Thank you,