• 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

Hello! I have a ? about stopping something from showing on category pages.

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 › Hello! I have a ? about stopping something from showing on category pages.

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 10 years, 4 months ago by LionArcherWeb.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 22, 2015 at 12:31 pm #138283
    LionArcherWeb
    Member

    There are tons of ?s in the forum, I tried to locate my issue but I guess its harder because of the different terms/jargon we all used. Thanks in advance for helping me out.

    I wanted to embed my adsense into my posts, I finally learned to so this with the help of edit css and simple hooks plugin. I'm happy about this because it provides me with the best ctr (they are temporarily off my website as I try to figure this out).

    I run into issues when viewing my category pages. The ads show up on every excerpt and I want this to not happen. It makes a blank space where the ad should be and makes the layout look awkward.

    Can I prevent this from happening? I tried to use a code like <if single?> (not exactly it but I'm sure you guys would know what I mean) but it didn't prevent the ads from showing in category pages.

    I was thinking of creating a single.php custom file for my news pro child theme but I'm not sure about that or editing the genesis single.php.

    Any tips or suggestions to point me in the right direction?

    So I added a little bit of content for you :HELLO STUDIOPRESS MY AD IS USUALLY HERE

    And also here is my category page: http://thetaoism.com/category/uncategorized/

    http://thetaoism.com
    January 22, 2015 at 2:09 pm #138288
    Ren Ventura
    Member

    If you want the adsense code to appear ONLY on single posts, use a conditional like this:

    if ( is_singular( 'post' ) ) { ?>
    
    	Adsense code here
    
    <?php }
    

    If you need further help, post the code you're using so someone can take a look.


    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    January 22, 2015 at 8:11 pm #138359
    LionArcherWeb
    Member

    This code did not work for me. Can you explain specifically where you would want me to post it? Was I to post it into my genesis single.php? It is the only method I did not try. Would you really like for me to post my code? I actually am not doing anything but using the simple hooks plugin. If you are talking about the small edit I made to the .css then it is as follows:

    .Adsensepost {
    float: right;
    padding-left: 15px;
    }

    and then within the genesis_entry_header Hook:

    <div class="Adsensepost">my ad code</div>

    I don't know what I'm missing...

    January 22, 2015 at 8:52 pm #138362
    Ren Ventura
    Member

    Since you're using the Simple Hooks plugin, you'll need to start/end the code with PHP tags and select the check box to execute PHP.

    <?php if ( is_singular( 'post' ) ) { ?>
    
    	Adsense code here
    
    <?php } ?>
    

    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    January 23, 2015 at 7:55 pm #138475
    LionArcherWeb
    Member

    Thanks so much! It's almost exactly like the first code I tried to write, but I was missing some important elements... (like 'post' lol) Thanks so much it helped me understand my mistakes.

  • 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

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