Archived topic
Easy Way to Add SubCategory Visual Index to Category Page
3 replies · Started by Bettijo on February 18, 2021
Hello!
Currently my category pages display what I think is the default -- just a chronological archive of posts from that category. I would like to have certain of my category pages display a visual subcategory index with a thumbnail image for each of the subcategories.
Can someone please point me towards the best route to achieving that result? If it is easier to use some sort of global setting, I might be able to make it work to have subcategories display like this on all my main category pages; although, I think my preferred solution would be to just add it to certain categories where it makes sense.
I appreciate your advice! Thanks --b
Hi Bettijo,
You could build a static page with your desired subcategories layout manually, then use this Wordpress filter to replace the default Category archive page link.
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/
I think this is the easiest way, let me know if there's anything you don't understand well :)
Sounds like the perfect solution, but when I click the link it looks like this will apply to EVERY category page. Is there a way to have it only work for specific ones and leave the other ones as the default category pages?
Try Tom's solution here instead, this code only replace the category default link when there's a same slugged and named static page exists. It won't effect the other category pages.
https://generatepress.com/forums/topic/custom-category-pages/#post-1110735
For example, only if you create a static page using Holiday as name and slug, the Category holiday archive page would be replaced by this static page, otherwise it stays as the way it was.