Forums

[resolved] next/previous (2 posts)

  1. miowebdesigns
    Member
    Posted 9 months ago #

    Maybe a simple question but here goes: this is code I am using to display posts on a page. I need to navigate to more posts, forward and back. I want navigation above and below the posts (top and bottom of page. I there are lots of possibilities, I think but which will work for my case? Anyone?

    <table>
      <tr>
        <td>
    
    <?php $myquery = new WP_Query(); $myquery->query('posts_per_page=6&cat=6,4'); ?>
    <?php while ($myquery->have_posts()) : $myquery->the_post(); ?>
        <div id="news">
        <div class="single" id="post-<?php the_ID(); ?>">
          <a href="<?php the_permalink(); ?>">
          <?php if(has_post_thumbnail()) {  ?>
          <?php the_post_thumbnail('large');?>
          <?php } else { ?>
          <img src="<?php bloginfo('template_url'); ?>/images/no_image.png" alt="no image available"/>
          <?php } ?></a>
          <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
          </div><!--single-->
          </div><!--news-->
        <?php endwhile; ?>
        </td>
      </tr>
    </table>
  2. vtxyzzy
    Member
    Posted 9 months ago #

Reply

You must log in to post.

About this Topic