- This topic has 16 replies, 3 voices, and was last updated 1 year, 7 months ago by
Tom.
-
AuthorPosts
-
May 26, 2019 at 4:30 pm #911588
Allison
Hey,
So I’m working on a site that has some custom post types setup via a plugin (past developer work). I’m looking to set some custom headers via elements for the custom post type category archive page but it won’t let me. It works fine for a custom post type single post but not the category archive page. I set the location to Resource Category and then selected the category name and it won’t work.
Any suggestions?
Thanks,
Allison
May 26, 2019 at 6:16 pm #911608Leo
StaffCustomer SupportHi there,
Can you try this filter:
https://docs.generatepress.com/article/generate_header_element_display/With this conditional tag?
https://codex.wordpress.org/Conditional_Tags#A_Post_Type_ArchiveLet me know if this helps π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 27, 2019 at 9:30 am #912328Allison
I applied the filter and tag and it removed the header from showing on a single custom post type but still nothing is showing on the custom post type category page.
May 27, 2019 at 10:06 am #912380Leo
StaffCustomer SupportCan you link me to the page where you want the header element to show?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 27, 2019 at 10:33 am #912411Allison
I edited my initial post to include the URL, please be careful not to post it anywhere as it’s sensitive information for a client site I’m working on. Resource Categories: Guides, Webcasts
Custom post type: Events are the ones I am having trouble with.May 27, 2019 at 1:14 pm #912543Leo
StaffCustomer SupportThe site requires a password to view. Can you provide it?
You can send the dashboard access using Account Issue here:
https://generatepress.com/contact/Please include the following information:
β The URL of this topic.
β Login URL.
β Username and password.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 27, 2019 at 4:03 pm #912637Allison
Hi Leo,
I sent the information you require via the account issue contact form. Let me know when you are finished as I’ll have to delete that user account afterwards.
May 28, 2019 at 8:50 am #913484Leo
StaffCustomer SupportWhat is the code you’ve tried?
What about this?
add_filter( 'generate_header_element_display', function( $display, $element_id ) { if ( 10 === $element_id && is_tax( 'qsc_resource_category' ) ) { $display = true; } return $display; }, 10, 2 );
Make sure to replace
10
with the actual ID.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 28, 2019 at 3:38 pm #913788Tom
Lead DeveloperLead DeveloperWhile a filter like that should work, it shouldn’t be necessary. The Display Rules should work with custom post types as long as they’re set up correctly.
Can you share a screenshot of your Display Rules?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 28, 2019 at 4:09 pm #913821Allison
Hi Tom,
Here is a sceenshot for the display rules for the custom post type category Guides. The page hero won’t show up.
May 29, 2019 at 8:09 am #914473Tom
Lead DeveloperLead DeveloperSo that will apply to posts inside that category.
Try “Resource Category Archive”.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 29, 2019 at 11:54 am #914687Allison
Doesn’t work, I even tried making my own custom post type archive and it still won’t work. Screenshot of settings
May 29, 2019 at 3:20 pm #914823Tom
Lead DeveloperLead DeveloperHmm, what happens if you create a Hook Element using a test hook (
before_header
) with the same Display Rules? Does it display?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 29, 2019 at 3:49 pm #914844Allison
The hook works, just tested it with some words
May 29, 2019 at 4:01 pm #914853Tom
Lead DeveloperLead DeveloperGood news.
Any other Header Elements on the site? If so, can you set them to “Draft” temporarily to see if one of them is conflicting?: https://docs.generatepress.com/article/conflicting-display-rules/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.