• 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

Hooks Only in Posts

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 › General Discussion › Hooks Only in Posts

This topic is: not resolved

Tagged: filters, hooks

  • This topic has 3 replies, 2 voices, and was last updated 10 years ago by Davinder Singh Kainth.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 30, 2013 at 8:20 pm #76355
    psvj
    Member

    Hey everyone-

    Is there a way to get a hook to ONLY show up when viewing a post page?

    i.e. not when looking at a category page, or a blog page--- only when looking at a SINGLE post?

    I am trying to use hooks to at adsense to the bottom of all of my posts-- but cannot get it to work without going like 100 ads at the bottom of every post summary on a category / blog page.

    thanks for the help

    November 30, 2013 at 9:17 pm #76362
    Davinder Singh Kainth
    Member

    This tutorial should help you - http://www.basicwp.com/add-adsense-ads-genesis-single-posts/


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

    November 30, 2013 at 11:42 pm #76390
    psvj
    Member

    Thanks !

    i ended up finding this snippet of code- which did the trick--

    /* Filter the_content() */
    add_filter( 'the_content', 'my_content_filter' );

    function my_content_filter( $content ) {
    if ( is_single()) {
    $content .= ' insert content ';
    }
    return $content;
    }

    December 1, 2013 at 8:59 pm #76528
    Davinder Singh Kainth
    Member

    Welcome !


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ 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