Site logo

[Support request] Excluded site header still showing

Home Forums Support [Support request] Excluded site header still showing

Home Forums Support Excluded site header still showing

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #2542202
    Robert

    Hi,
    I have a directory on my site using Directories Pro plugin. I also have a regular blog type format.

    I am trying to have a different header for the directory aspects. I have contacted you previously regarding the menu and will try the conditional menu plugin.

    I am having another issue and I am not sure if it is GP or the Directories Pro plugin.

    I have managed to enable and exclude the two headers I have for different pages within the elements editor.

    I have tried to do the same thing for the custom categories generated by the directory plugin.

    In the header element editor it allows me to enable and exclude the two headers as I have done previously with different specific pages but when I check the category page nothing changes.

    I have cleared cache etc and even made other changes to other pages to check and they update correctly.

    On the actual directory category page (such as https://cryptosavvylife.com/discover-crypto/categories/agtech/ )it shows the elements loaded and they are the ‘old’ original ones. With the original Block Site Header rather than the new Discover Crypto Header.
    However, within the element editor, it shows the new header should be enabled and the original excluded.

    Am I missing something?
    (I have screen grabs but am not sure how to share them)

    Regards,
    Rob

    #2542221
    Fernando
    Customer Support

    Hi Robert,

    Can you provide admin login credentials instead so we can take a closer look at your setup?

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2542251
    Robert

    Thanks,
    That would be greatly appreciated.

    #2542270
    Fernando
    Customer Support

    Can you try removing the Category in the Display Rule location and re-adding it?

    #2542274
    Robert

    Hi,
    I have tried and tried to do it for other categories that were created with the same results.

    Will try doing it now (remove AGTECH) and then redo it for the AI category.

    Thanks,

    #2542281
    Fernando
    Customer Support

    Alright. Let us know how it goes.

    #2542282
    Robert

    Hi,
    I have done that for category/ai and have the same thing.

    Thanks,

    #2542286
    Robert

    Within the Directories Pro plugin there is an option to assign your own custom permalink and also to point to a custom page for the location.
    I am sure this has something to do with it as the breadcrumbs on the category page seem wrong.

    I can adjusting some of the settings in Directories Pro unless you have any other suggestions.

    Thanks,
    Rob

    #2542290
    Fernando
    Customer Support

    I see. Can you try adding this snippet?:

    add_filter( 'generate_block_element_display', function( $display, $element_id ) {
        if ( 19180 === $element_id && is_category( array('182','180' ) ) ) {
            $display = false;
        }
    
        return $display;
    }, 10, 2 );

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    #2542303
    Robert

    Hi,
    I loaded the plugin etc and got this error:
    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 3:

    syntax error, unexpected token “;”
    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    #2542314
    Robert

    Hi Fernando,
    Im fairly certain its is a directories pro thing.

    The URL I was expecting ( https://cryptosavvylife.com/directory-research/categories/ai/) says the page cannot be found. The URL it is displaying instead when clicking on some links ( https://cryptosavvylife.com/discover-crypto/categories/ai/) is not what the GP elements editor is finding.

    I think I should investigate that before you spend anymore time on it.

    I will wait for you to confirm.

    Thanks,
    Rob

    #2542317
    Fernando
    Customer Support

    I updated the code I provided above. Can you retry adding it?

    #2542319
    Robert

    Sure, but where is the updated code?

    #2542321
    Robert

    Sorry realised the above had changed, have run the snippet.

    #2542328
    Fernando
    Customer Support

    Try this one:

    add_filter( 'generate_block_element_display', function( $display, $element_id ) {
        if ( 19180 === $element_id && is_tax( 'category', '180' ) ) {
            $display = false;
        }
    
        return $display;
    }, 10, 2 );

    Replace category in the code if the plugin you are using is using a different taxonomy slug.

    This code is for agtech category.

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