WordPress.org

Ready to get started?Download WordPress

Forums

Category or Page? (4 posts)

  1. greencode
    Member
    Posted 1 year ago #

    I'm not sure what to use here. I have 10 categories and I have a bit of intro text and an image on each category page. That would lead me to believe that I should use a page to show each category's posts and then create a new page template for each.

    A few things though:

    1. That would mean creating 10 identical templates but only changing the category ID in the query.

    2. If I wanted to call the pages the same as the categories then I would have to rename the categories as the category will supersede the page slug.

    Not sure how to play it.

    Any ideas or thoughts would be greatly appreciated.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    One solution would be to create a page template that retrieves a custom field containing the id of the category. Then create a Page for each category and put the id of the category in the custom field.

    I used that approach for this site. Everything you see under 'ADS AND MORE' and 'GOOD STUFF' is handled by a single template which gets the category from a custom field named 'category-to-show'.

  3. greencode
    Member
    Posted 1 year ago #

    Oooh, I like that idea. Very neat.

    I suppose with regards to the slugs I'll just have to name the categories something like blog-category, news-category etc so I can then call the pages blog, news etc.

  4. vtxyzzy
    Member
    Posted 1 year ago #

    I don't know if it matters, but if you are using the WP Appearance Menus, you can title the Page anything you want but have the menu label as something else.

Topic Closed

This topic has been closed to new replies.

About this Topic