Some Help Hooking With New Genesis 2 Markup

Community Forums Forums Design Tips and Tricks Some Help Hooking With New Genesis 2 Markup

This topic is: resolved

This topic contains 5 replies, has 2 voices, and was last updated by  Marcy 1 year, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #52635

    Alessandra
    Participant
    Post count: 30

    Hello, Guys!

    I was waiting for an update of the genesis simples hooks plugin, but seems like its gonna take a while…

    I had somethings hooked with that plugin before i updated to genesis 2.0.

    With this update i lost my hooks since many of them changed.

    Now i need to do it through my functions.php i guess, but the thing is that i am having a very hard time with it. I already consulted a lot of tutorials and videos but i get no result at all… =/

    The content i used to have hooked with the genesis simple hooks is this, and it goes into the old genesis_after_post_content Hook:

    <?php if (is_single()) { ?>
    <div class="prev_next">
            Contentet here
        </div>
    
    <div class="share-and-subscribe">
    		Content goes here
    	</div>
    
    <?php } elseif ( is_page() ) { ?>
    <div class="share-and-subscribe">
    		content goes here
    	</div>
    <?php } ?>
    
    

    Would someone please help me out with this?

    Best regards.

    • This topic was modified 1 year, 1 month ago by  Alessandra.
    • This topic was modified 1 year, 1 month ago by  Alessandra.
    #52677

    Marcy
    Participant
    Post count: 326

    You can try using the ‘genesis_entry_footer’ hook instead of ‘genesis_after_post_content’
    You could also try ‘genesis_after_entry’ but that will be a bit farther below.

    My guess is that the plugin with updates will be released as soon as Genesis 2.0 is.

    So you would use this:

    add_action(‘genesis_entry_footer’, ‘custom_entry_footer’);
    function custom_entry_footer() {
    [ your content here ]
    }


    #52730

    Alessandra
    Participant
    Post count: 30

    Thank you so much, Marcy!

    That worked like a charm!

    I just had to change the hook for posts because inside genesis_entry_footer i got the content also showing bellow the excerpts on the home page when i just want this content available bellow the post content inside itself.

    I used:

    add_action( 'genesis_before_comments', 'genesis_before_comments_custom' );
    function genesis_before_comments_custom() { if ( is_single() ) ?>
    
    <div>
    [CONTENT]
    </div>
    
    <?php
    }

    And tried to replicate it to also show this content on pages but with a slightly different content with this:

    add_action( 'genesis_after_endwhile', 'genesis_after_endwhile_custom' );
    function genesis_after_endwhile_custom() { if ( is_page() ) ?>
    
    <div>
    [CONTENT2]
    </div>
    
    <?php
    }
    

    But i got this last piece of content2 also showing on posts…. =/

    Am i doing something stupid?

    • This reply was modified 1 year, 1 month ago by  Alessandra.
    • This reply was modified 1 year, 1 month ago by  Alessandra.
    #52879

    Marcy
    Participant
    Post count: 326

    You’re doing great! Conditionals are tricky. :)
    I think for CONTENT2, this line should be:

    <?php function genesis_after_endwhile_custom() { if ( ( is_page() ) && (!is_single() )) ?>

    This means if it’s a page and not single, so that should keep it from showing on your posts.


    #52881

    Alessandra
    Participant
    Post count: 30

    Thanks in abundance, Marcy!

    You’re my Queen from now on! =}

    You made it work perfectly!

    I S2 You!

    #52990

    Marcy
    Participant
    Post count: 326

    Fantastic! You did it!
    You’re welcome. :)


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

You must be logged in to reply to this topic.