Genesis Hooks

Community Forums Forums General Discussion Genesis Hooks

This topic is: not resolved

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  slydawgg 7 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #57993

    kkuzik
    Participant
    Post count: 9

    I see that there is an area to add something to the genesis_after_post_content but why does it show on the page if it is for Post Content? Is there a way to just have the content that I want added here to just the posts and not pages as well?

    http://expertsportsperformance.com
    #58044

    cdils
    Participant
    Post count: 399

    Hi there,

    In WordPress vernacular, both pages and posts are a considered a “post type”, so the genesis_after_post_content hook isn’t reserved just for posts. (Here’s more info in nerd terms).

    To do what you’re wanting, tou’ll need to use a conditional statement along with that hook to only display on pages. Here’s an intro tutorial to conditional statements. You’ll want to use the is_single() check to only show you’re info on posts.

    So you might have a conditional that looks like:

    
    add_action ( 'genesis_after_post_content', 'add_my_stuff' );
    
    function add_my_stuff() {
         
        if ( ! is_single )
             return;
    
        echo 'add your text here';
    }
    

    Cheers,
    Carrie


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. :)

    I tweet @cdils.

    #58090

    kkuzik
    Participant
    Post count: 9

    Thanks!

    #59062

    slydawgg
    Participant
    Post count: 20

    @cdils – I’ve tried your method but cannot seem to make it do what I am trying to do. Hopefully you have an idea regarding this issue:

    http://www.studiopress.com/forums/topic/category-vs-single-featured-images-ideas-agency/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.