• Hi everybody. I’m sure other people have asked this but I cannot find the answer to this question anywhere, so here I go.

    I’m looking to build a site that has pages with static content. So far so good. But I would like each page to contain a different list of posts.

    As I understand, I need to use categories instead of pages in order to achieve this, but if I use categories, my ‘pages’ (category pages) will only contain posts and no static content. How do I get the best of both worlds? A page that is the parent of a category.

    Thank you for helping me, I’m only just starting out with WP. I’m familiar with php and html, so don’t worry about getting technical if you must.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sounds like a good use for a new template in your child theme. Then you could add the get_posts function with which ever category (or other items) to pull the posts you want. I also found elsewhere in support that there is a get posts plugin (though not on WP.org) that you can use a shortcode to accomplish the same thing if you prefer not to use a custom template.

    Thread Starter koen_ahn

    (@koen_ahn)

    I see, so you suggest including a loop with get_posts on my pages. I got that far, and I know how to filter the posts only to show a specific category. But how can I fetch the category that fits the current page? Should I manually make an array that associates pages with categories in my php? Isn’t there a more sophisticated way that fundamentally links the pages and posts in the back-end? Or should I just make the linked category ID a custom field in the page?
    Thank you for your time ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page as parent of category’ is closed to new replies.