• 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

Genesis Simple Hooks – Disable on page template

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 › Genesis Simple Hooks – Disable on page template

This topic is: not resolved

Tagged: Simple Hooks, template

  • This topic has 5 replies, 5 voices, and was last updated 11 years, 7 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • October 29, 2014 at 5:37 pm #129818
    Tal
    Member

    I am using a theme based on the magazine template along with genesis simple hooks.

    I have a page of my site on which I need to disable some of the content generated via the genesis simple hooks plugin.

    The page on the site is already using an alternate template, so can I add something to the page template to remove the simple hooks function?

    Basically, I am using simple hooks to embed google ads on my site, but I have a page on which google ads are not allowed (chat room) so I need to find a way to remove the ads from that one page.

    October 30, 2014 at 3:54 am #129852
    mickmel
    Member

    You can do it inside of the hooks box. I believe this will work:

    <?php
    if (!is_page(57)) {
    ?>
    your adsense code
    <?php
    }
    ?>

    Change "57" to the page id of your chat room, of course, and be sure to check the "Execute PHP on this hook" below the box.

    October 30, 2014 at 5:08 am #129858
    Brad Dalton
    Participant

    You could add code directly to the template

    Or use a conditional tag like:

    <?php if ( ! is_page_template('page_landing.php') ) ?>
    

    http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template


    Tutorials for StudioPress Themes.

    November 27, 2014 at 2:15 pm #133038
    remcotv
    Member

    I like to us the genesis_before_post Hook for showing content above a single post.

    But it should not show this content above posts on the overview in the category page, or the page with an overview for all posts related to a tag.

    I only want to show above a single post, how to accomplish this with simple hooks, or should i modify the templates

    November 28, 2014 at 4:47 pm #133162
    anotherusername
    Participant

    I only want to show above a single post, how to accomplish this with simple hooks, or should i modify the templates

    Do you want this to show on a POST??? Or on a page???

    You can use simple hooks. If you modify the template, and then you decide to change child themes, then you will lose the changes.

    Try something like:

    <?php if (is_single()) {
    
    ?>

    Put all your stuff you want to show here / your adsense code

    <?php
    
    }
    
    ?>

    The above will work on a single POST (not on archives)

    If you want it to work on single POSTs, single PAGES, single CPT, and single media, then use

    is_singular()

    instead of

    is_single()

    November 28, 2014 at 7:02 pm #133168
    Brad Dalton
    Participant

    Try this http://wpsites.net/web-design/add-widget-area-before-content/

    The code goes in functions.php


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 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

© 2026 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