Looking to wrap posts in a div

Community Forums Forums Design Tips and Tricks Looking to wrap posts in a div

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  DigitalEssence 1 year, 9 months ago.

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

    DigitalEssence
    Participant
    Post count: 9

    Hi,

    I’m trying to wrap my posts in a div but can’t see how to close the div off.

    I’m looking to have a new div straight after .post-info div and ending right after .post-meta so my post title, content and meta are all wrapped in a div.

    I’m going to use the genesis_before_post_title to open the div but can’t find an action to drop my /div just before¬†</div><!– end .postclass –>

     

    Thanks

    #30542

    DigitalEssence
    Participant
    Post count: 9

    Found the solution myself so here it is for anyone else looking:

     

    //Add opening div before the post title
    add_action( ‘genesis_before_post_title’, ‘custom_post_div’, 15 );
    function custom_post_div() {
    echo ‘<div class=”post_body”><!– start .post_body–>';
    }
    /** Customize the post meta function to add closing div */
    add_filter( ‘genesis_post_meta’, ‘post_meta_filter’ );
    function post_meta_filter($post_meta) {
    if ( !is_page() ) {
    $post_meta = ‘[post_categories before="Categories: "] [post_tags before="Tags: "] </div>';
    return $post_meta;
    }}

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

You must be logged in to reply to this topic.