• 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 + PHP

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 › Hooks + PHP

This topic is: not resolved

Tagged: home page, hooks, php, posts

  • This topic has 4 replies, 3 voices, and was last updated 11 years, 7 months ago by Sridhar Katakam.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • October 16, 2013 at 10:06 pm #67121
    dawnbar
    Member

    Hi there,

    Can someone help?

    Using hooks to add some images after post content - and all is dandy, looks lovely. 🙂

    However, using Outreach and the content I've added is showing on the home page, which looks silly (but still lovely!)

    I am using this:

    <?php if(is_single()) { ?>
    <div>
    mystuff
    <?php } ?>

    And it's the <?php if(is_single()) { ?> part that I can't get my head around.

    To exclude this php function on the home/front page and still include it after single posts only (not pages), how is written? Oh and do I need to end the code in a different way?

    Can anyone help. Have no idea how to write php, I usually find in here an answer. I have no idea if the above makes sense, but it does to me!

    Many thanks,

    Dawn

    October 16, 2013 at 11:57 pm #67129
    vabmedia
    Member

    yes, end the code with } ?>
    and you're basically saying that if you are on a single blog post page { --//start executing this code-- end the "if" php code } ?>

    October 17, 2013 at 12:12 am #67130
    Sridhar Katakam
    Participant

    See if this helps: http://sridharkatakam.com/adding-entry-widget-area-single-posts-outreach/


    Genesis Tutorials | Follow me on Twitter

    October 17, 2013 at 5:11 pm #67237
    dawnbar
    Member

    Thank you both.

    Sridhar thank you, it's not what I was wanting to do. But I have bookmarked your site. What a resource.

    I am sorry, but now seeing a little clearer...

    How would I say...

    if on single blog post show this // but not if on the home page (or front page)

    And how would I specifically end that?

    Many thanks for your time and getting me closer to lifting foggy php knowledge.

    Dawn

    October 18, 2013 at 1:11 am #67271
    Sridhar Katakam
    Participant

    Try this:

    if ( is_single() ) { ?>
    
    	HTML here 	
    
    <?php }
    
    elseif ( is_home() || is_front_page() ) { ?>
    
    	HTML here 	
    
    <?php }

    Genesis Tutorials | Follow me on Twitter

  • 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