- This topic has 13 replies, 2 voices, and was last updated 4 months, 2 weeks ago by Ying.
March 24, 2022 at 11:42 am #2166346Martin
Hi there. I would like to use custom fields and layout in Archives (lists of custom posts).
Could you advise what location I need to put the Hook Element if that’s the right approach or advise what is the best approach?
Thank you.March 24, 2022 at 12:45 pm #2166395YingStaffCustomer Support
Are we talking about custom post type archive?
What kind of layout are you trying to achieve?
Let me know 🙂March 24, 2022 at 1:12 pm #2166417Martin
It is for a custom post type archive but I want to customise the layout for all archives.March 24, 2022 at 1:18 pm #2166422YingStaffCustomer Support
You can create block element – content template to create a custom look of archives:
And here’s a video demonstrate how to access custom fields in block element:
The location of the element would be
custom post type archive, for example, if your custom post type is movie, then you would see
Movie Archivein the location dropdown.March 24, 2022 at 2:36 pm #2166469Martin
Hi. I have the right location selected but can’t find where to customise the contents of the archive loop.
I don’t want to create a hero section. Not sure if I am using the correct wording here but it’s the contents of the ‘loop’ that makes the list of posts I am looking to customise.
Thanks.March 24, 2022 at 2:40 pm #2166474Martin
I figured it out…
generate_after_entry_title hook.March 24, 2022 at 2:50 pm #2166484Martin
Although I am trying to disable thumbnail (featured image) in all archives.
Tried it by disabling the featured image in a layout element applied to ‘all archives’ but not managed to disable the featured image.March 24, 2022 at 2:50 pm #2166485YingStaffCustomer Support
content templateas the element type, you should not need to select
hook.March 24, 2022 at 2:55 pm #2166492Martin
‘Content Template’ as an Element type?
Not seen that type of Element?March 24, 2022 at 2:57 pm #2166495YingStaffCustomer Support
Here’s the documentation of the block element – content template, there’s also a demonstration video which should be helpful:
https://docs.generatepress.com/article/block-element-content-template/March 24, 2022 at 3:27 pm #2166513Martin
Thanks. I’m a bit out of practice with GeneratePress so I have some learning to do with blocks. Although I’ve had premium for many years I’ve not built with it for a couple of years so I’m a bit rusty.March 24, 2022 at 3:35 pm #2166519YingStaffCustomer Support
The block element – content template is still a new thing to a lot of GP users, it’s normal if you haven’t tried play with it!
It’s a really powerful tool, hope you’ll enjoy building site with it!
Just let us know if you run into problems 🙂March 24, 2022 at 3:45 pm #2166528Martin
I created a simple block but can’t see how to apply it to my custom post type archives. Archives are not essential to the project I’m working on but it would be handy to figure out how to work with them in GP.March 24, 2022 at 3:58 pm #2166532YingStaffCustomer Support
Make sure you watch the video carefully and understand how each step works.
Once the content template is built, select the
custom post archiveas location.
It should apply to your custom post archive page.
- You must be logged in to reply to this topic.