Site logo

Archived topic

GP HOOKS (header and footer)

29 replies · Started by Armando on September 14, 2017

Viewing posts 1–15 of 30

Hi,
I want to use the hooks to show header and footer across my website. So I tried inserting

"[elementor-template id="1346"]" in before header, wp head and before header content. None works, but the page http://www.new.neighborhoodsun.solar/community/our-neighborhood/ shows the code at the top. This page http://www.new.neighborhoodsun.solar/community/who-we-are/ shows the code in the 3 hooks I placed it in.

Right now you can see the right header (and footer) already in most of the pages, as I added the elementor template in each page one by one.

I could do that for all pages, yet that solution doesn't satisfy me as I ultimately want the header to be sticky and the "Sticky Menu (or Anything!)" plugin only allows one object at any time.

Any advice? Thank you a lot!

Hi Leo,

So should I insert this code

<?php if ( in_category( 'hearing' ) ) : ?>
<?php echo do_shortcode( '[elementor-template id="1346"]' ); ?>
<?php endif; ?>

in the "before header content" hook?

Thanks for your advice!

Without the If statement.

Like this: <?php echo do_shortcode( ‘[elementor-template id=”1346″]’ ); ?>

Hey Leo,
I inserted that code into "before header content" hook, and did the same for the footer in "after footer content with the element id "1572".
It doesn't show though, check the page http://www.new.neighborhoodsun.solar/community/learn-more/ I deleted the header and footer from this page as they should appear anyway because of the hooks. In all other pages where header and footer appear is because I pasted them from the elementor template.
What am I missing?
Thanks!

Did you check execute PHP?

yes, all hooks have "execute php" checked, and "disable hook" is not checked.
I tried putting the code in different places, also doesn't work. I checked again the IDs of the two elements, and they're correct.
thanks,
armando

Ahh wrong quotation mark I think. Try

<?php
    echo do_shortcode("[elementor-template id='1346']");
?>

I don't know Leo, it still doesn't show it. I tried putting the code in different places, still elements are not there. Yet, you can see the code, like in http://www.new.neighborhoodsun.solar/community/uncategorized/hello-world/ (that page is not designed yet).
In most pages like this one http://www.new.neighborhoodsun.solar/community/our-neighborhood/ the elements show up as I plugged them in in each page singularly, but for example I removed them from http://www.new.neighborhoodsun.solar/community/learn-more/
"execute PHP" is flagged while "disable hook" is not, and that is on the "GP hooks" page under appearance. Is there maybe some other setting that makes the hooks disabled?

Thanks Tom, I sent them to you.

It looks like you're using the Canvas page template, which strips the page of all theme related things, including hooks. If you want the hooks to show, you'll need to use the regular Default page template.

Let me know if that helps or not :)

Also, if you are in the home and you hover over the menu, the pages that are nested in do not show :(

The menu dropdowns aren't working as you have a few javascript errors on the page - a couple related to a sticky sidebar plugin, and one from Elementor itself.

As for the shortcode not working - it seems Elementor isn't even showing the shortcodes to use in the Library area. I'm not familiar enough with Elementor to know why that would be. Maybe you have a conflicting plugin? You can try deactivating each plugin one by one to check.

This archived topic is closed to new replies.