Archived topic
Archive layout using content template
9 replies · Started by David on July 22, 2021
Hello
I've added a new custom post type called investments, now I would like to style the archive page for the custom post type, using the content template option in blocks. I've added a layout, but when I choose Investment Opportunities Archive on the location, it doesn't show the layout.
https://thepropertyfund-com.stackstaging.com/investments/
What am I doing wrong.
Thanks
Dave
Hi there,
how have you generated the Templates for the Custom Post Type?
This article provides a simple how to - so it uses the functions GP requires for the Block Element to work with:
https://docs.generatepress.com/article/setting-up-a-simple-custom-post-type/
Thanks David, that helped. Can you also use the block content template for woocommerce archives?
You're welcome
Woo integration - not at this time, its something we're looking at for a future update!
Ok, that would definitely be a great one to have. I've used toolset to do this previously using blocks, but would be great to have it in generateblocks.
Totally - Woo will ( no doubt ) have to embrace block templates in the future so we're just mindful of not implementing something that may conflict or become redundant if/when they decide to make that change.
Hi David
Can you feed in a selection of posts from a custom post type, on say the homepage, using generateblocks?
Thanks
Dave
The Block Element Content Template only works with archive templates.
If the home page was set to display your latest posts, and it was filtered to pre_get just your custom post type then it could be applied.
But if you're looking for functionality like what WP Show Posts does, to just display a section of posts in a static page, then no.
Thats a future update for WPSP or GB Pro - or a possible integration with the Query Block that just landed on WP 5.8.
Ok thanks
You're welcome