Home › Forums › Support › Elementor Header & Footer Templates, Toolset (or other plugin) using conditional
- This topic has 8 replies, 2 voices, and was last updated 7 years, 8 months ago by
Tom.
-
AuthorPosts
-
September 24, 2018 at 5:05 pm #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).
September 24, 2018 at 8:51 pm #685580Tom
Lead DeveloperLead DeveloperGlad you found a solution! Thanks for sharing it with us 🙂
September 24, 2018 at 9:44 pm #685588Stu
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
September 25, 2018 at 3:24 pm #686316Tom
Lead DeveloperLead DeveloperWhen 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?
September 25, 2018 at 3:59 pm #686326Stu
Hey Tom – This way
..,
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
StuartSeptember 25, 2018 at 4:18 pm #686331September 25, 2018 at 8:19 pm #686403Tom
Lead DeveloperLead DeveloperAre 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.
September 25, 2018 at 8:39 pm #686414Stu
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.
September 26, 2018 at 9:57 am #687002Tom
Lead DeveloperLead DeveloperFrom 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.
-
AuthorPosts
- You must be logged in to reply to this topic.