• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Looking for a hook

Welcome!

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.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Looking for a hook

This topic is: not resolved

Tagged: advert, genesis, hooks

  • This topic has 4 replies, 2 voices, and was last updated 7 years, 1 month ago by JamesLuff.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 24, 2016 at 2:15 pm #191973
    JamesLuff
    Member

    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.

    SolaSpot Pro 1500 Review

    For a comparison, see the advert on the homepage:

    http://www.techietalk.co.uk/

    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:

    http://www.techietalk.co.uk/category/news/lighting/

    Can anyone help me find or accomplish want I'm trying to do here?

    August 24, 2016 at 3:36 pm #191982
    Victor Font
    Moderator

    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() ).


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 24, 2016 at 3:40 pm #191983
    JamesLuff
    Member

    genesis_before_loop looks to hit the spot! Can you give me more help with the (!is_front_page()) condition?

    August 24, 2016 at 3:40 pm #191984
    JamesLuff
    Member

    Forgot to say THANK YOU!

    August 24, 2016 at 3:44 pm #191985
    JamesLuff
    Member

    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.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble