Archived topic
Using page header on custom post types
22 replies · Started by Gabriel on January 8, 2017
Hi!
I'm trying to use the Page Header add-on on a custom post type. I can set everything with the meta in the admin, but the page header elements aren't displaying on the page once published. Do I need to add instruction somewhere so my custom post type can use the page header add-on?
thanks!
If the page you're viewing is the index of your custom post type, WordPress ignores the meta box values (same as the blog index for example).
However, you can use the Blog Page Header and apply it to your custom post type: https://docs.generatepress.com/article/blog-page-header/
I did try that, but it doesn't work. I'm using pods.io framework to manage my custom post type. The page I'm working on is here: https://splitboardqc.ca/splitboard/prior-shotgun-split-159-xtc/. Any other idea on why the page header isn't displaying?
thanks!
Getting a 404 at that URL.
Can I see the code you're using to apply the blog page header to that page?
I'm having issues with Siteground so my site is throwing 404 on all pages :(. As for the code, I'm not using any php, I'm using the meta boxes from the admin pages or the customizer.
My site is back online now, you should be able to display the page.
Hmm, doesn't look like an index page, so the meta box should work.
Can you show me a screenshot of your Page Header meta box on that page?
Sure! Here:
Hmm, is there any way you can send me temporary admin login details? https://generatepress.com/contact/
I've added support@generatepress.com as an admin.
Hmm, not really sure what's going on there.
What if you create it as a regular page? It works? It might have something to do with it being a custom post type.. Is it using a custom template?
It's working A1 on everything except the post types created by pods. To my understanding, it's not using custom templates. My plan B is to create pages and fetch the pods data. I'll move on on that path.
The only reason I can think of is that the hooks are present on the templates used by pods. The page header is simply hooked into the generate_after_header hook, so if it's present it should display.
Hi Tom,
So have I understood... we can't add a Page header section to a custom post type post? (even though the Page Header section box is present on all edit screens?) So is there no other 'get-round' (other than using the Blog Header image feature - I would want to add a different header to multiple posts?
Thanks,
Andy
I'm working on something very, very cool related to this right now. Hoping it's going to be the main big feature in GP Premium 1.4 :)