Support » Themes and Templates » Two Column of Posts (two posts per row)

  • Hi everyone,

    I want to have two posts per row. I have made my theme from what I’ve learned on this page this morning, WPTUTS.

    This is my coding for my index.php page.

    <?php get_header(); ?>
    <?php /* If there are no posts to display, such as an empty archive page */ ?>
    <?php if ( ! have_posts() ) : ?>
            <h1>Not Found</h1>
                <p>Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post</p>
    <?php endif; ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <div class="post">
        <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
        <div class="post-details">
            <div class="post-details-left">
            Posted on <strong><?php the_date(); ?></strong> by <span class="author"><?php the_author(); ?></span> under <span class="author"><?php the_category(', '); ?></span>
            <div class="post-details-right">
            <?php edit_post_link('Edit', '<span class="comment-count">  ' , '</span>'); ?><span class="comment-count"><?php comments_popup_link('Leave a comment', '1 Comment', '% Comments'); ?></span>
        <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
                <?php the_excerpt(); ?>
        <?php else : ?>
                <?php the_content('Read More'); ?>
        <?php endif; ?>
        <div class="dots"></div>
    </div><!-- post -->
    <?php endwhile; ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
            <div id="older-posts"><?php next_posts_link('Older Posts'); ?></div>
            <div id="newer-posts"><?php previous_posts_link('Newer Posts'); ?></div>
    <?php else: ?>
            <div id="only-page">No newer/older posts</div>
    <?php endif; ?>
    <div class="spacer"></div>
    <?php get_footer(); ?>

    If anyone could help it would be greatly appreciated as I’ve been trying to figure it out for hours. (I’m going crazy -_-)

    Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two Column of Posts (two posts per row)’ is closed to new replies.