Archived topic
After Header hook
3 replies · Started by Ryan on January 31, 2019
I was noticing the after_header hook works correctly on blog post types, it is placed right after the menu before the content and featured image. But if a featured image is enabled on a page the after header hook is after the featured image. Is there a way to place something before the featured image but after the header on pages?
Hi there,
you can try reducing the priority (default is 10) on the hook, a lower number will hook it earlier.
But it shouldn't come after an in post featured image. Can you link us to a page where that is happening.
I noticed it on one of the few pages I have a featured image not disabled here so its not a big deal https://www.ryansmithphotography.com/please-get-in-touch/office-location/, the breadcrumbs should before the featured image.
When the featured image is above the content area like that, the priority matches the default (10).
So in this case, the featured image is initiating before the Element, which is why the Element is after.
If you reduce the priority of your Element as David suggested, it will work :)