
I have been trying to search a code that would display a WordPress Post in 3 columns. But I haven’t found any of it that actually works the way I want it to be..
So I decided to create my own 3 column WordPress Post.
Here it is:
<table border="0" cellspacing="10" cellpadding="0" align="center">
<?php
// You can change the cols to 4 if you want to have 4 columns.. or any number..
$cols = 3; // Number of Columns to be displayed
$colsdisp = 0; // No column display yet
?>
<?php if (have_posts()) : ?>
<tr>
<?php while (have_posts()) : the_post(); ?>
<?php
if ($colsdisp == $cols) {
print "</tr>\n<tr>\n";
$colsdisp = 0;
}
?>
<?php echo "<td>"; ?>
// Your contents here
<h2><?php the_title(); ?></h2>
<p><?php the_excerpt(); ?></p>
// Contents Ends here
<?php echo "</td>\n"; ?>
<?php $colsdisp++; ?>
<?php endwhile; else: ?>
<p>Sorry, no products matched your criteria.</p>
<?php
$colsexec = $cols - $colsdisp;
for ($i=1; $i<=$colsexec; $i++) {
}
print "<td valign=\"top\"></td>\n";
?>
</tr>
<?php endif; ?>
</table>
Plug-in simplifies creating layouts, type and form components Drag and drop elements from WebZap to create folders with UI shapes and text layersAlthough quite a few developers ...
Sleek RWD revamp emphasises readability, accessibility and modern reading habits TNW's new site is streamlined, readable and usableInternet technology, business and culture blogThe Next Web has unveiled a ...

The 58th PSME Annual National Convention and Philippine Mechanical Engineering International Exhibition (PHILMEX 2010) is the premier event for academicians, researchers, leading engineers, technical personnel, representatives from government sector, private business and industry professionals, and students to network, debate current issues, and examine strategies that will help them chart the future of the profession in various research and instructional programs. It aims to create an opportunity for delegates to discuss developments in their respective field ...