WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2 columns for each post (8 posts)

  1. visual mechanics
    Member
    Posted 2 years ago #

    How do I format the content of a post to have two columns? Similar to this http://notesonthedivine.tumblr.com

    Image on the left and text on the right.

    Is there a simple way to do this?

    Thanks,
    Rob

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Float the images left and place the text in a div with a width of 50% that is then floated right.

  3. visual mechanics
    Member
    Posted 2 years ago #

    Did that and all of the content is pushed to the right.
    http://francescaromeo.com/blog

    code:

    <div class="entry-content">
        <div class="entry-content-text">
    <?php the_content('<span class="more-link">'.__('Continued reading >', 'simplr').'</span>'); ?>
    
    <?php link_pages('<div class="page-link">'.__('Pages: ', 'simplr'), "</div>\n", 'number'); ?>
    </div>
    </div>

    css:
    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    <div class="entry-content">
    <div class="entry-content-text">
    <?php if( has_post_thumbnail() ) the_post_thumbnail();?>
    <?php the_excerpt(); ?>
    <p class="more-link"><a href="<?php the_permalink();?><?php _e('Continue reading ');?></a></p>
    <?php link_pages('<div class="page-link">'.__('Pages: ', 'simplr'), "</div>\n", 'number'); ?>
    </div>
    </div>

    Get rid of the float:right on #entry-content-text, align the post thumb left and add a float right to something like #entry-content-text p

  5. visual mechanics
    Member
    Posted 2 years ago #

    i swapped that code into place and got a fatal error about post_thumbnail...

  6. visual mechanics
    Member
    Posted 2 years ago #

    is there somewhere else i have to insert code in my themes index.php file or another file?

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    To enable post thumbnails, the current theme must include add_theme_support( 'post-thumbnails' ); in its functions.php file.
    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

  8. visual mechanics
    Member
    Posted 2 years ago #

    over my head. where in the functions.php file do I put this tag?
    <?php the_post_thumbnail( $size, $attr ); ?>

    i got the alignment to work via inserting the image aligned left which moves the text over. the next task is controlling the behavior of the entry-meta tags so they resolve underneath and do not creep up into the post.

Topic Closed

This topic has been closed to new replies.

About this Topic