Support » Themes and Templates » Link category to page

  • Resolved mastron


    Hi There

    I have a hard question, at least to me. I can sove it on a large way but I like it to be small.

    I have 10 categories and 10 pages.

    What i would like to happen is that the page sport only shows posts in the category sport. I know I can make 10 page templates with only the category post in it, but I was wondering if it is posible in one page.

    I was thinking of something like:

    if page title is sports show category=1


    if page title is news show category=2



    But then in PHP .. which I am not good at.

    The website I am making is:

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Wrong approach. Do NOT use Pages – they are not for displaying posts.

    You need Category_Templates.

    I need to use pages. My menu is built up on the pages I made, so a category list does not work for me.

    If I use a category template I have to make 10 category pages and I like to use one page.

    Is it posible and how?

    I still think it is easier to change one line of code in the menu than changing how WordPress works… and if you are not styling them differently you don’t even need Category Templates (or only one).

    Anyway, if you want to do it in your way – you are welcome. Just don’t ask for help if you know better.

    I understand what you are saying. I would prefer to do it that way and use category selection in my menu. But the thing is that I am using a plugin to show my pages:

    This plugin shows the pages and not the categories, please have a look at the site that I am working on:

    Got it:


    if (is_page(‘Nieuws’)) {

    } else if

    (is_page(‘Lokaal’)) {

    } else if

    (is_page(‘Gemeente’)) {

    } else if

    (is_page(‘Sport’)) {

    } else if

    (is_page(‘Cultuur’)) {

    } else {
    query_posts(‘cat=’ . $events_cat . ‘&paged=’ . $paged);

    Does that code go into the page.php template? and/or index.php?

    Nevermind… Got it! Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Link category to page’ is closed to new replies.