Alternate Posts Layout
-
[ Moved to the Fixing WordPress sub-forum. ]
Hi can anyone help me please??
I am trying to alternate my grid layout so that I have it displaying like:
image text
text imageBut 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
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;?>
The topic ‘Alternate Posts Layout’ is closed to new replies.