Title: Alternate Posts Layout
Last modified: July 28, 2017

---

# Alternate Posts Layout

 *  [websak](https://wordpress.org/support/users/websak/)
 * (@websak)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/__trashed/)
 * _[ Moved to the [Fixing WordPress sub-forum](https://wordpress.org/support/topic/before-posting-in-everything-wordpress/).]_
 * Hi can anyone help me please??
 * I am trying to alternate my grid layout so that I have it displaying like:
    image
   text text image
 * But i am getting the following layout and dont really know where i am going wrong.
   Please see below my code. and screenshot of what i am experiencing.
 * screenshot = [https://www.dropbox.com/s/vntl3y4x21fr5w8/Screen%20Shot%202017-07-27%20at%2016.21.46.png?dl=0](https://www.dropbox.com/s/vntl3y4x21fr5w8/Screen%20Shot%202017-07-27%20at%2016.21.46.png?dl=0)
 * Thank you
 *     ```
         <?php while ( have_posts() ) : the_post(); ?>
               <?php
               for ($i = 0; $i <= 0; $i++)
               {
                 //odd counter will have right image
                 if ($i % 2 == 0)
                 {
                   ?>
                   <div class="grid_12">
                     <div class="post-item odd">
                       <div class="grid_6 col1 image">
                         <?php	$image = get_field('news_image'); ?>
                         <img />">
                       </div>
                       <div class="grid_6 col2 ">
                         <div class="post">
                           <h2><?php the_title(); ?></h2>
                           <?php the_content(); ?>
                         </div>
                       </div>
   
                     </div>
                   </div>
                   <?php
                 }
                 //even counter will have left image
                 else
                 {
                   ?>
                   <div class="grid_12">
                     <div class="post-item even">
                       <div class="grid_6 col1">
                         <div class="post">
                           <h2><?php the_title(); ?></h2>
                           <?php the_content(); ?>
                         </div>
                       </div>
                       <div class="grid_6 col2 image">
                         <?php	$image = get_field('news_image'); ?>
                         <img />">
   
                       </div>
                     </div>
                   </div>
                   <?php
                 }
               }
               ?>
             <?php endwhile;?>
       ```
   
    -  This topic was modified 8 years, 10 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This topic was modified 8 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

The topic ‘Alternate Posts Layout’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/__trashed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
