adding a clear div before comments

Community Forums Forums General Discussion adding a clear div before comments

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 6 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #66475

    babrees
    Participant
    Post count: 59

    As the subject says, is anybody able to help me add a <div class=”clear”></div> just before comments using a code snippet in my functions.php?

    I have a site using galleries and because of their float left comments often end up beside instead of below.

    Cheers

    #66480

    braddalton
    Participant
    Post count: 7470

    Try something like this:

    add_action('genesis_before_comments', 'add_div_before_comments');
    function add_div_before_comments() {
    if( is_singular('post') ) {
        echo '<div class="clear">Before Comments</div>';
    } }
    

    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

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

You must be logged in to reply to this topic.