[Resolved] Can’t hide nav menu with option_generate_blog_settings filter

Home Forums Support [Resolved] Can’t hide nav menu with option_generate_blog_settings filter

Home Forums Support Can’t hide nav menu with option_generate_blog_settings filter

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1468146
    Jim

    Kind of carrying over this question from the wordpress plugin support site, now that I’ve purchased GP Premium.

    I’m trying to not have the primary nav menu on single posts of a custom post type (ncpage). I activated the Blog module, and understand that should activate the filter I’m trying to use. Here’s what I have in functions php and is not working:

    add_filter( 'option_generate_blog_settings', 'fp_no_nav' );
    function fp_no_nav( $options ) {
        if ( is_singular( 'ncpage' ) ) {
    		$options[‘single_post_navigation’] = false;
        }
        return $options;
    }

    Any thoughts?

    #1468152
    Leo
    Staff
    Customer Support

    Hi there,

    You can actually use a layout element for that:
    https://docs.generatepress.com/article/layout-element-overview/#disable-element

    The CPT should be listed under the display rules.

    Let me know if this helps 🙂

    #1468193
    Jim

    Thanks. Finally got it to work. Being new to GP Premium, it would be helpful if, in those articles, it would say which modules need to be activated to use it. In this case, it seems to be both Elements and Disable Elements. Presumably those modules need to be kept activated for it to continue to work?

    #1468287
    Leo
    Staff
    Customer Support

    You should only need to keep the Elements module activated.

    The disable element module is for the metabox options:
    https://docs.generatepress.com/article/disable-elements-overview/

    #1469101
    Jim

    OK, I was confused I’m sure. Maybe I activated Disable Elements for a different reason. Thanks for your help.

    #1469525
    Leo
    Staff
    Customer Support

    No problem 🙂

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