WordPress.org

Ready to get started?Download WordPress

Forums

Pages in Posts, specific categories (5 posts)

  1. WombatofAvalon
    Member
    Posted 2 years ago #

    Hi,
    I'm really a noob at this, but I managed to make the page that lists posts on a page, but I need it to only show certain categories on the pages. Since I am going to have several pages that have multiple post categories on them, I am hoping there is a way I don't have to have multiple template files that say include only this category.

    I read over conditional tags and some other areas of the codex but I'm still confused. Is there a way to somehow make it do this based on something I put on the page or in the page custom field area. Like if custom area is Recipes then it only shows the posts in category recipies?

    Thanks for any help,
    Wombat

  2. keesiemeijer
    moderator
    Posted 2 years ago #

    Theme template files category.php or archive.php are used to display one category. If you need a Page that shows posts from multiple categories use a custom page template with a query posts.

  3. WombatofAvalon
    Member
    Posted 2 years ago #

    Right now I'm using the pages of posts template I found in the codex. I am not understanding how to use the query function in the right way. I can see how you can tell it to query a specific category. Can I do it so that it checks something on the page so it knows which category to specifically show?

    Or will I need a separate template for each page I'm using the pages of posts for? I was hoping to avoid that since I'm going to be doing this a few times.

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    Do you mean this Page of Posts: http://codex.wordpress.org/Pages#A_Page_of_Posts

    Can I do it so that it checks something on the page so it knows which category to specifically show?

    In the Page of Posts (codex) article they use a custom field to show a specific category

  5. WombatofAvalon
    Member
    Posted 2 years ago #

    okay thanks. I will play with this and see if I can get it to work.

Topic Closed

This topic has been closed to new replies.

About this Topic