Site logo

Archived topic

Custom header hooks plus new page for custom post type

30 replies · Started by Paul on December 31, 2019

Viewing posts 1–15 of 31

Hi,

I recently created (Leo is familiar) a new custom post type called "Projects" - I'd like some help creating a custom hook for this CPT to display just like the single post. In addition I would like to have a page set up to display all the projects just like the blog page does for posts. Thanks!

I should clarify for the project page - I'm happy to use the WP show posts, just looking for a custom hero header.

Would it work if you just add the CPT under the display rules of that header element?

Sorry what doesn't work?

Adding the CPT to the the display parameters added the header properly.

I tried the same for this page https://www.trademarkinteriors.com/projects/ but the header does not appear. Looks like I will need help with a hook for this page.

At this point I just need a hook to display a hero image similar to the blog page except it will be a static image (blog page changes with latest post). Thanks!

In that case, you may want to create a new Header Element just for the projects page. That way you can explicitly set a hero image for it in the settings :)

Tom,

Initially I tried that and it did not work so I believe I became confuse thinking I needed a hook element. I do see that there is a custom header element for merged header that applies to all pages, would I need to exclude the project page in that element in order for the new header element to work? Thanks.

Hi there,

that is correct, when using global rules such as All Pages, you need to also exclude any Pages that you wish to apply a separate Header Element too.

Hi David,

Happy New Year to everyone!!

Good to know - I tried that and it still does not appear so I modified the hook for the blog to the following which worked! Just let me know why the header element does not work??

<h1>
Projects
</h1>

Do you have any other header elements that may be conflicting ?

This archived topic is closed to new replies.