The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Showing categories just for a certain page. (2 posts)

  1. cacahuete
    Posted 3 years ago #

    To make things short... my problem is that I want certain categories to show up for a certain page and not for all.

    My site contains these pages: Home, articles, about, contact
    Now the About, contact and the home page are static, articles not and therefor I have a couple of categories under them. I want them to show up just for ARTICLES, how do I do that?

    Thanks a million, a gazillion!

  2. Noumaan Yaqoob
    Posted 3 years ago #

    you need to create a template for articles page.

    Copy the contents page.php from your current theme and create a new file page-articles.php with these contents.

    artilces is the slug for your articles page. you can also replace it with page id like this page-10.php

    in page-articles.php before or after the post content paste this code where you want categories to be displayed. I assume that you want comma separated categories below each article or may be after the article title:

    <?php echo get_the_category_list(', ',' '); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic