query paging issues (2 posts)

  1. azsportshub
    Posted 8 years ago #

    Hi everyone. This one is baffling me as I have used this same code on another blog and had success. Here is the issue: I am building a blog within another blog. I have installed Category Template Inheritor to do this. I have also set up a template file called "blog" and am calling two custom queries. The problem lies with the paging. I have set it up as instructed here: http://codex.wordpress.org/The_Loop and here: http://codex.wordpress.org/Template_Tags/query_posts.

    Paging however, will not go, no matter what variation I am working with. Here is a synopsis of the code in question from here(http://wp.corpedia.com/blog):

    Template Name: Blog
    <?php get_header(); ?>
    <?php $my_query = new WP_Query('cat=10&showposts=3');
      while ($my_query->have_posts()) : $my_query->the_post();
      $do_not_duplicate = $post->ID;
    <?php endwhile; ?>
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    if ( have_posts() ) : while ( have_posts() ) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts);
    	<div class="post" id="post-<?php the_ID(); ?>">
    	<h2><a href="<?php the_permalink() ?>" rel="bookmark" border="0" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		<?php the_excerpt(); ?>
    <?php endwhile; ?>
    <?php else : ?>
    	<div class="post">
    	<h2 class="center">Not Found</h2>
    		<div class="entry">
    		<p>Sorry, but you are looking for something that isn't here.</p>
    <?php endif; ?>
    <?php get_footer(); ?>
  2. azsportshub
    Posted 7 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic