Archived topic
Best way to customize category archive pages?
13 replies · Started by Anne on September 24, 2020
I have a couple questions for customizing the category archive pages
1. If I wanted to add a header to each category archive, would the best route be to create a block header for each one?
2. Is there a way I can edit the layout of the category blog posts from within the theme? Say if I wanted to make it a 2 column layout instead of 1 column? And is there a master option for this so I can change 'all' category archive pages to have the same layout from one setting instead of doing it one by one?
Thanks
Hi there,
1. Yes, thats correct you can create a Block Element for each of your Category archives.
Or you can use a Header Element, if you're happy with the same color/image background on all - and the only difference being the title. Then you could could create a single Header Element and add the {{post_title}} template tag to display the title dynamically.
2. Yes, you would need to use the option_generate_blog_settings filter:
https://docs.generatepress.com/article/option_generate_blog_settings/
If you want a hand writing the snippet let us know.
Great thanks for the info! I ended up following one of your videos on customizing Layout > Blog and did it that way.
I have another question, but this is regarding wp show posts:
Let's say I have 2 different categories displayed on the homepage but some posts share the same category - is there a way to prevent the posts with multiple categories from displaying twice?
Maybe this snippet Tom provides will help removing duplicates:
Thanks that looks like it will be helpful once I understand how to implement that code of his. Im basically not sure how to apply that code from that thread.
Would you be able to explain how to implement that or should i reach out to wpshowposts and maybe reply to that thread itself?
That code can be added with one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/
The Code Snippets plugin is the easiest if you aren't using a child theme already.
Hey there,
I want to show my first 4 category archive posts like in the grid 50% - 50%. In first container there is the latest post and in another there are three posts stacked on top of each other. I tried to add it with a block-hook element and with dynamic content but it shows only one post four times. I also wish to display a post title not category title.
Can you please help me achieve this.
Thank you!
Hi there,
thats not possible within the theme templates.
If you want to raise a new topic i will explain someways of how it could be done.
Hi David,
I raised a new topic called 'Custom category archive page'.
Best regards.
Thanks - replied :)
I have a question maybe relate with this post:
How can I creat a category of Archive for my website https://kimquy.com.vn/blog/ like that webste: https://www.ultimatebeaver.com/modules/advanced-posts/example-4/
It displays some category of blog with a beautifull style
All Creative Fashion Outdoor Portraits
Hi there,
You should be able to create a content template for the blog posts using a block element - content template:
https://docs.generatepress.com/article/block-element-content-template/
But if you want to have the tabs to filter categories without redirecting to another category archive page, there'll be some custom development required.
Thank you but I don't need to custom display for blogs in Archive Blog.
I need add a category for Archive Pages: List of all category blog.
How can I do?
Can you open a new topic for your question?
Thanks!