- This topic has 7 replies, 2 voices, and was last updated 3 years, 8 months ago by
Tom.
-
AuthorPosts
-
September 18, 2018 at 9:30 pm #680769
Tyler
I’m trying to get CPT categories to show up in the main query (which is now successful) but my hooks disappear>
Here’s my markup:
function generate_add_custom_types( $query ) { if( is_category() || is_tag() && $query->is_main_query()) { $query->set( 'post_type', array( 'post', 'nav_menu_item', 'after_footer_widgets', 'manufacturers' )); return $query; } } add_filter( 'pre_get_posts', 'generate_add_custom_types' );
I added “nav_menu_item” which made the menu post type reappear. So I tried for my hook too but that doesn’t seem to do it since its not its own post type.
How do I get GP hooks to show up again? π Thanks!
GeneratePress 2.1.4GP Premium 1.7.2September 19, 2018 at 8:49 am #681309Tom
Lead DeveloperLead DeveloperHi there,
You could try adding
gp_elements
to the array of post types to display?Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 19, 2018 at 1:09 pm #681515Tyler
Hey Tom,
Thanks!
Partial success – that restored my “layout” elements. But my hooks are still not coming through.
does the gp_elements post type contain hooks as well?
September 19, 2018 at 9:58 pm #681789Tom
Lead DeveloperLead DeveloperElements do have a “Hook” type. Is that what you’re using?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 20, 2018 at 11:28 am #682404Tyler
Yes, “hook” elements aren’t showing…or rather, my after_footer_widgets is not showing.
adding “gp_elements” post type seemed to restore my “layout” elements (those weren’t showing before), but after_footer_widgets still isn’t appearing.
I just tested another hook (before_header) and that is appearing…
September 20, 2018 at 10:57 pm #682706Tom
Lead DeveloperLead DeveloperWhat happens if you switch that same problem hook to
before_header
? Does it show?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 21, 2018 at 1:01 pm #683303Tyler
It doesn’t show there either, BUT plain text appears just fine. So the BB shortcode was the issue!
I’m rendering a Beaver Builder shortcode in the footer hook hook site-wide that’s failing to appear on that CPT archive. The page is made with Themer and there isn’t any console error so I figured the BB post type was already showing.
Added fl-builder-template to the function and voila. π Thanks!
September 21, 2018 at 6:17 pm #683454Tom
Lead DeveloperLead DeveloperAwesome! Glad you got it working π
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.