• I use the theme Twenty Twelve and I want my posts on the frontpage in 2 colums from a specific category .

    Are there some one who has a css code/ html code I need to put into my child theme?

Viewing 1 replies (of 1 total)
  • Thread Starter diannadk

    (@diannadk)

    I have found some code, but not sure where I add the loop code

    <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post(); else : the_post(); ?>
    
    <div id="left-column">
    <h1><?php the_permalink(); ?></h1>
    <?php the_content(); ?>
    </div>
    
    <?php endif; endwhile; else: ?>
    <div>Alternate content</div>
    <?php endif; ?>
    
    <?php $i = 0; rewind_posts(); ?>
    
    <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query->next_post(); else : the_post(); ?>
    
    <div id="right-column">
    <h1><?php the_permalink(); ?></h1>
    <?php the_content(); ?>
    </div>
    
    <?php endif; endwhile; else: ?>
    <div>Alternate content</div>
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘wp post i 2 colum’ is closed to new replies.