{"id":577,"date":"2015-10-23T10:03:14","date_gmt":"2015-10-23T10:03:14","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=577"},"modified":"2024-01-16T08:47:33","modified_gmt":"2024-01-16T08:47:33","password":"","slug":"display-term-as-heading","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/display-term-as-heading\/","title":{"rendered":"Display WordPress category name above posts list (display term as heading)"},"content":{"rendered":"<p>With Content Views Pro, you can display category name above posts list easily.<\/p>\n<h2 id=\"one-term\"># Display a term above posts list<\/h2>\n<p>Let&#8217;s add new View to start. Here are some simple steps to do:<\/p>\n<ul>\n<li>Enable the <strong>Taxonomy (Categories, Tags&#8230;)<\/strong> in Filter Settings &gt;&gt; Advance<\/li>\n<li>Select the taxonomy you want to use, for example: Category<\/li>\n<li>Select the term (a category, a tag&#8230;) you want to show as heading, above the posts list<\/li>\n<li>Select the option <strong>Show (first) term as heading of output<\/strong> for the &#8220;Output modification&#8221; setting<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1594\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/Content-Views-Pro-Show-category-as-heading.png\" alt=\"\" width=\"675\" height=\"476\" srcset=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/Content-Views-Pro-Show-category-as-heading.png 675w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/Content-Views-Pro-Show-category-as-heading-300x212.png 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/p>\n<h2 id=\"many-terms\"># Display many terms above their posts list<\/h2>\n<p>If you want to display multiple categories, tags&#8230; above their posts list like this:<\/p>\n<pre>Category #1\n\u00a0\u00a0\u00a0\u00a0 post A, B, C, ...\n\nCategory #2\n\u00a0\u00a0\u00a0\u00a0 post O, P, Q, ...\n\nCategory #3\n\u00a0\u00a0\u00a0\u00a0 post X, Y, Z, ...\n<\/pre>\n<p>Here are 2 simple steps:<\/p>\n<ul>\n<li>Create a View for a category (<a href=\"#one-term\">with above instruction<\/a>).<\/li>\n<li>Reuse this view to show other terms above their posts.\n<p>For each <strong>category<\/strong>, please use following shortcodes:<br \/>\n<code>[pt_view id=VIEWID cat=CATEGORY_SLUG]<\/code><br \/>\n<em>(replace VIEWID with ID of the View which you&#8217;ve created)<\/em>.<\/p>\n<p>For each <strong>tag<\/strong>, please use this shortcode format:<br \/>\n<code>[pt_view id=VIEWID tag=TAG1_SLUG]<\/code><\/p>\n<p>For each <strong>custom taxonomy<\/strong>, please use this shortcode format:<br \/>\n<code>[pt_view id=VIEWID taxonomy=\"TAXONOMY_SLUG\" terms=\"TERM_SLUG\"]<\/code><\/p>\n<p>To find TAXONOMY_SLUG and TERM_SLUG, please open the Taxonomy page, you will find TAXONOMY_SLUG in the URL, and TERM_SLUG in the Slug column:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5727\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/taxonomy-term-slug.png\" alt=\"\" width=\"838\" height=\"453\" srcset=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/taxonomy-term-slug.png 838w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/taxonomy-term-slug-300x162.png 300w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2015\/10\/taxonomy-term-slug-768x415.png 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/li>\n<\/ul>\n<h2 id=\"view-all\"># Show the &#8220;View all&#8221; link beside the category name<\/h2>\n<p>Please add this code to <strong>Custom JS<\/strong> field (the right textarea) in <a href=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2018\/03\/Content-Views-_-Settings.png\">Content Views &gt;&gt; Settings<\/a> page:<\/p>\n<pre style=\"font-size: 13px;\">$('.pt-cv-term-heading a').each(function(){\n$(this).html($(this).html() + '&lt;span style=\"float:right\"&gt;View all&lt;\/span&gt;');\n});\n<\/pre>\n<p>Thank you,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Content Views Pro, you can display category name above posts list easily. # Display a term above posts list Let&#8217;s add new View to start. Here are some simple steps to do: Enable the Taxonomy (Categories, Tags&#8230;) in Filter Settings &gt;&gt; Advance Select the taxonomy you want to use, for example: Category Select the &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/display-term-as-heading\/\"> <span class=\"screen-reader-text\">Display WordPress category name above posts list (display term as heading)<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[9],"doc_tag":[17],"class_list":["post-577","docs","type-docs","status-publish","hentry","doc_category-how-to","doc_tag-category-tag-taxonomy"],"year_month":"2026-09","word_count":280,"total_views":"3","reactions":{"happy":"0","normal":"2","sad":"1"},"author_info":{"name":"admin1","author_nicename":"admin1","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/admin1\/"},"doc_category_info":[{"term_name":"How To","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/how-to\/"}],"doc_tag_info":[{"term_name":"category tag taxonomy","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/category-tag-taxonomy\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=577"}],"version-history":[{"count":12,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/577\/revisions"}],"predecessor-version":[{"id":5737,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/577\/revisions\/5737"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=577"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=577"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}