[Resolved] Custom header hooks plus new page for custom post type

Home Forums Support [Resolved] Custom header hooks plus new page for custom post type

Home Forums Support Custom header hooks plus new page for custom post type

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #1118250
    Paul

    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!

    #1118656
    Leo
    Staff
    Customer Support

    Hi there,

    CPT should show up in the display rules by default. Is it not showing for you?

    As for displaying posts for CPT, you could consider using this plugin:
    https://en-ca.wordpress.org/plugins/wp-show-posts/

    #1118736
    Paul

    Leo,

    Sorry if my question was not clear.

    The CPT shows up – my question is for formatting the pages.

    I would like this page (CPT) https://www.trademarkinteriors.com/projects/kitchen-remodel-wyckoff-nj-3/ to look like this page format https://www.trademarkinteriors.com/wet-bar-vs-dry-bar-full-review-and-comparison-of-home-bars/

    Thanks.

    #1118748
    Paul

    I would also like this page https://www.trademarkinteriors.com/projects to look like this page https://www.trademarkinteriors.com/blog/

    Thanks!

    #1118749
    Paul

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

    #1119201
    Leo
    Staff
    Customer Support

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

    #1119227
    Paul

    It worked for the single CPT, not for the project page https://www.trademarkinteriors.com/projects/

    #1119370
    Leo
    Staff
    Customer Support

    Sorry what doesn’t work?

    #1119388
    Paul

    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.

    #1119391
    Paul

    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!

    #1119447
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #1119698
    Paul

    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.

    #1119967
    David
    Staff
    Customer Support

    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.

    #1119973
    Paul

    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>
    #1120025
    David
    Staff
    Customer Support

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

Viewing 15 posts - 1 through 15 (of 31 total)
  • You must be logged in to reply to this topic.