- This topic has 4 replies, 2 voices, and was last updated 7 years, 1 month ago by .
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I'm after a hook that executes on a post or page before the article, it can be before or after the breadcrumb. I want to use it to insert an advert... for example, on the page linked below the advert would ideally appear above the article and below the breadcrumb in the blank space.
For a comparison, see the advert on the homepage:
I'd like that advert block to exist on every page.
I've had a look and there's nothing in the "content" hooks that let's me insert anything that I can see... If I did then that would appear on the homepage too, which isn't the objective here.
Other than that, I can find a "genesis_before_entry" hook, which appears to be in the right position, but it executes in the loop, so I end up with the on EVERY entry. That's no good, I just want one at the top! For example, on the following page I'd end up with adverts before every entry:
Can anyone help me find or accomplish want I'm trying to do here?
You could try genesis_before_content_sidebar_wrap or genesis_before_loop. If you don't want the ad on the front page, wrap the hook code in a condition if ( !is_front_page() ).
genesis_before_loop looks to hit the spot! Can you give me more help with the (!is_front_page()) condition?
Forgot to say THANK YOU!
Actually, I don't think I need it... just putting the ad code in the hook and removing the instance in the widget seems to have achieved the desired results! Brilliant stuff, thanks again.
© 2023 WPEngine, Inc.