@zubair04
B.T.W.
The two column posts look great when the text is the same, create a post with different sizes of words and you might find that the posts get out of line.
If you look at the page the two columns widths do not align with the header image, this is due to the right margin in the second column.
[——Header—–]
[Post 1]-[Post 2]-
[Post 3]-[Post 4]-
I use a different class for the left and right columns, and this makes the posts line up nice across the page and where the text is shorter or longer, clear both on the left and no margin on the right.
.column-left{
clear: both;
float: left;
position: relative;
margin-right: 7.6%;
width: 46%;
}
.column-right{
float: left;
position: relative;
width: 46%;
}
Then in the content or loop I add a counter variable.
<?php $counter = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $counter++; //Increment the Counter ?>
<?php if($counter % 2) : ?>
<div class="column-left">
<?php else: ?>
<div class="column-right">
<?php endif; ?>
<!-- Post Output Code Here -->
</div>
<?php endwhile; ?>
Just thought I would add this comment as you might want to revisit the layout with different content values.
HTH
David
this is a problem that i was about to deal with next, as i put in a temporary measure to change to layout to this.
thanks very much david for this code, i will try and implement this now and see how it works.
much appreciated !
ive tried implementing the code and if u visit the site , the posts are just repeated infinitely 😐
would anyone mind taking a look and see where im going wrong with this ?
thanks again
…sorted out now.
thanks everyone for your help, saved me a lot of time