Site logo

[Support request] Elementor Header & Footer Templates, Toolset (or other plugin) using conditional

Home Forums Support [Support request] Elementor Header & Footer Templates, Toolset (or other plugin) using conditional

Home Forums Support Elementor Header & Footer Templates, Toolset (or other plugin) using conditional

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #685506
    Stu

    Hey guys – this is incase anyone comes across it in the future – took me a while to figure it out.

    When using Elementor Pro and setting a Footer (or Header) template and adding a shortcode that uses any kind of conditionals – it renders the body content twice. To fix this you must disable the Generate Press header and footer hooks.

    Template: Generate Press + Pro
    Elementor
    Elementor Pro
    Toolsets.com (Types, Views)

    Here is the Toolset Thread: https://toolset.com/forums/topic/elementor-and-content-templates-in-header-and-footer-renders-full-page-content/#post-1114549

    I have figured it out – there was a conflict with Generate Press Pro and and Elementor – when using conditionals in Toolset (and other plugins with conditionals).

    You need to go in to GeneratePress Hooks (in the Appearance menu) – then disable wp_footer hook ad the wp_header hook placements.

    This will then render the conditional correctly (but not in preview in the Header and Footer templates in elementor).

    #685580
    Tom
    Lead Developer
    Lead Developer

    Glad you found a solution! Thanks for sharing it with us 🙂

    #685588
    Stu

    also – not sure if this should be noted… but could be…

    If you change the theme from GeneratePress to a standard wordpress theme and then back to GeneratePress – you “DONT” have to disable the header and footer hooks – they work fine again?

    It seems to depend on the order of activation?

    My Concern here would be if Elementor or GeneratePress is updated it could affect the blocks and therefore affect this running correctly

    #686316
    Tom
    Lead Developer
    Lead Developer

    When you say this:

    You need to go in to GeneratePress Hooks (in the Appearance menu) – then disable wp_footer hook ad the wp_header hook placements.

    How exactly are you doing it?

    #686326
    Stu

    Hey Tom – This way disable..,

    But I’ve also found the changing from generatepress to a different template and then back again work without disabling the header and footer … bit weird.

    Let me know if you need any more testing.

    Cheers
    Stuart

    #686331
    Stu
    #686403
    Tom
    Lead Developer
    Lead Developer

    Are you sure it’s not just the code inside those hooks causing the incompatibility? Disabling a hook only prevents the code you input from being rendered on the frontend.

    #686414
    Stu

    the code in the hook that you can see in the screenshot is/was not causing any issues…

    It was both the header and footer section in elementor not taking the shortcodes with conditionals – disabling and reenabling the theme fixed it in both cases (or, before I did that disabling the hook in both cases).

    Pretty weird.

    #687002
    Tom
    Lead Developer
    Lead Developer

    From a coding perspective, I don’t see how that’s possible.

    Plugin code is always loaded before theme code in WordPress – it doesn’t matter if the theme is activated/deactivated: https://codex.wordpress.org/Plugin_API/Action_Reference (plugins_loaded vs after_theme_setup).

    Very weird indeed.

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