With Content Views Pro, you can display category name above posts list easily.
# Display a term above posts list
Let’s add new View to start. Here are some simple steps to do:
- Enable the Taxonomy (Categories, Tags…) in Filter Settings >> Advance
- Select the taxonomy you want to use, for example: Category
- Select the term (a category, a tag…) you want to show as heading, above the posts list
- Select the option Show (first) term as heading of output for the “Output modification” setting
# Display many terms above their posts list
How about display multiple categories, tags… above their posts list like this:
Category #1 post A, B, C, ... Category #2 post O, P, Q, ... Category #3 post X, Y, Z, ...
?
For example: you want to show each of 3 categories Business, People, Building above their posts list. Here are steps to do:
- Create a View, follow 4 steps in section I. above for a category.
- Use following shortcodes for 2 other categories:
[pt_view id=VIEWID cat=CATEGORY_SLUG_HERE]
[pt_view id=VIEWID cat=CATEGORY_SLUG_HERE]
(replace VIEWID with ID of the View which you’ve created)For tag, please use this shortcode format:
[pt_view id=VIEWID tag=TAG_SLUG_HERE]
[pt_view id=VIEWID tag=TAG_SLUG_HERE]
For custom taxonomy, please use this shortcode format:
[pt_view id=VIEWID taxonomy=NAME_OF_TAXONOMY terms=SLUG_OF_TERM]
# Show the “View all” link beside the category name
Please add this code to Custom JS field (the right textarea) in Content Views >> Settings page:
$('.pt-cv-term-heading a').each(function(){ $(this).html($(this).html() + '<span style="float:right">View all</span>'); });
Thank you,