posts thumbnails & title with link
-
How to link (a href) to thumbnail & title?
code:
<?php // Show a selected number of posts per row $posts_per_row = 4; $posts_per_page = 4; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => $posts_per_page, 'paged' => $paged,); query_posts('cat=3'); if (have_posts()) { while (have_posts()) { the_post(); if ((++$post_counter % $posts_per_row) == 1 || $posts_per_row == 1) { if ($post_counter > 1) { echo "</div><!-- End of post_row -->\n"; // End previous row } echo "<div class='post_row'>\n "; // Start a new row } echo "<div class='post_class' >\n"; // Start one post echo get_the_post_thumbnail($page->ID, array(160,87)); echo '<h3 style="font-size:15px; text-transform: uppercase; margin-top:5px;">';the_title();'</h3>'; echo "</div><!-- End of post_class -->\n"; // End of post } ?> </div><!-- End of post_row --> <div class='clear'></div> <?php } else { // Code for no posts found } ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘posts thumbnails & title with link’ is closed to new replies.