Need help with creating Category Page Template
-
Hello there,
I am still learning wordpress, so I have a few questions regarding Category templates.
For Context:
I am building a blog for myself and creating my own theme (so I am not using anyone elses theme or framework). My Website will have some static pages, like Home, About and Contact and then it will have a Blog page, where I will display some images and text as well as an overview of all my posts with an ajax post filter. (I know how to do all of that, no questions here)
Where I need some advice now is that I want to categorize my posts in 6 categories. And while there will be one main blog page that will display a grid overview with all posts (and ajax filter), I also want one page for each category that will have some general content (text and images) about the category and a grid overview of only the posts belonging to that category.
First, I thought for these 6 pages, I could simply create either an archive.php or category.php page. But I don’t like that option for two reasons:
1) the permalink: using that option would mean that the link would be shown as ‘www.website/category/category-name-1’, whereas I would prefer simply: ‘www.website/category-name-1’
2) I don’t think I would be able to create a template for these archive/category pages, right? Like, I want to display more than just the category title and description and related posts, I want a real page template with various ACF fields (images, text, etc). However, the layout/design of each category page template should be the same, just the content needs to be different on each)So, now I am thinking, instead of using the archive.php or category.php option, I would simply design a template page for these 6 categories and create them in WP backend normally as I would with other pages but then just assign the right template to it. That way I would have the link in the right way as I want it to.
However, for that option, my question is: can I actually use one template for that purpose? The layout/design of these 6 pages should be the same, but each page needs to show different posts –> So in the backend, if I create a page for ‘Category 1’, assign it to the right template, there I would need to be able to determine that only posts assigned to Category 1 are being displayed. Same thing for Category 2 and so forth. Is that possible? Or would I need 6 different page templates to show only the posts that belong to the category?
- The topic ‘Need help with creating Category Page Template’ is closed to new replies.