- This topic has 9 replies, 3 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 25, 2022 at 12:10 am #2432385
Scott
Hi there,
I want to make a custom Parent Category page by inserting GenerateBlocks above the ascending posts that live within that category. What’s the best way to do that?
Some background:
My goal is to have a site structure with permalinks as follows:
site.com/category/sub-category/post/Example with random category and subcategory names:
site.com/recipes/vegan/how-to-make-vegan-ice-cream
site.com/recipes/vegan/baked-vegan-lasagnaAnd I want to be able to design the Parent Category (i.e. site.com/category or site.com/recipes/) with a block from GenerateBlocks at the top of the Parent Category page highlighting the best subcategories – e.g. vegan, vegetarian, bbq, cocktails, etc. Specifically, I’m wanting to use this block from GenerateBlocks. However, I wasn’t able to find a way to do this with traditional post categories.
As a workaround, I then created a regular WordPress “Page” and was able to customize that as I wanted with Gutenberg and GenerateBlocks. Easy enough. I set the slug of the Page also to “recipes” and published it. But it’s effectively completely detached from the Post Categories and Subcategories, and the site.com/recipes goes to the normal parent category, not the “Page” slug. Because the hierarchy of Post Categories is taking priority.
And I cannot find a way to set the permalink structure such that the “Page” can be the parent category, with regular “Post Subcategories” living underneath.
I hope what I’m trying to do and this explanation make sense. If not, I’m happy to make a Loom video.
November 25, 2022 at 4:05 am #2432729David
StaffCustomer SupportHi there,
Just so i am 100% clear ( which for me can take some doing lol ), if i view this Parent Category page, and i split it into top and bottom sections, i would see:
Top section: a list / grid of sub categories
Bottom section: Latest post from the Parent CategoryIs that correct ?
November 25, 2022 at 8:28 am #2433429Scott
Exactly! And if possible, the top section would use the block from GenerateBlocks where I could add some text beneath each item in the grid, maybe a button to view all articles in the subcategory, etc.
November 25, 2022 at 1:59 pm #2434469Scott
Adding to the above, the main reason I want to use Gutenberg editor/design on the Post Category Archive page is to maintain a good site structure with permalinks. e.g. site.com/category/sub-category/post/
Rather than have an isolated “category” page at site.com/page which then links to subcategories or posts which aren’t on the same subdirectory path.
November 25, 2022 at 2:17 pm #2434508mikeb82
I have done similar pages using Generate Blocks and the WP Show Posts plugin.
For the posts sections of the page I create a container with Generate blocks and put a WP Show Posts shortcode in the container with the filters I need for the post content.
November 25, 2022 at 2:37 pm #2434552Scott
Thanks, Mike! How does the permalink structure work for that? If I understand correctly, that might be the workaround I tried with Pages but it doesn’t follow the permalink structure I’m looking for.
As a workaround, I then created a regular WordPress “Page” and was able to customize that as I wanted with Gutenberg and GenerateBlocks. Easy enough. I set the slug of the Page also to “recipes” and published it. But it’s effectively completely detached from the Post Categories and Subcategories, and the site.com/recipes goes to the normal parent category, not the “Page” slug. Because the hierarchy of Post Categories is taking priority.
And I cannot find a way to set the permalink structure such that the “Page” can be the parent category, with regular “Post Subcategories” living underneath.
My goal is to have a site structure with permalinks as follows:
site.com/category/sub-category/post/November 25, 2022 at 5:23 pm #2434781Scott
Did some more Googling, and I found that Elementaor allows customization to the Archive Category pages. So that will be my backup plan if it’s not doable with GP.
November 26, 2022 at 3:40 am #2435378David
StaffCustomer SupportHow many parent categories will there be ?
If there are only a few then the simplest approach would be to:1. create a Block Element – Page Hero for parent category 1.
2. add your GB block content for that category
3. set its Display Rules toCategory Archive -> specific term
4. Repeat the steps for each category.If there are a lot of Parent Categories then a more dynamic solution would make sense, but this would require some code to create the top section of content.
Let me know.
November 27, 2022 at 9:56 pm #2438206Scott
Thanks, David! I think this will work.
November 28, 2022 at 4:06 am #2438660David
StaffCustomer SupportGlad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.