Where to insert query_posts($query_string in category.php?
-
I have query_posts on my homepage to make it look more magazine style – 1 last post from each cat, and in category archives posts display normally. 10 posts for a page. The problem is that I cant see next 10 posts,because my pagination is not working. I click on the 2 page and it brings me to Error.
I was adviced to use
query_posts($query_string
in that template. But I have no clue how and where to insert it in the loop. Here is how my loop looks now
category.php
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php bloginfo('template_url'); ?>/images/<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>"></a><a href="<?php the_permalink() ?>" rel="bookmark" class="title""><?php // this is where title of the article gets printed the_title(); ?></a> <?php the_excerpt() ?> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> <?php else : ?> <h2 class="center">Not Found</h2> <?php include (TEMPLATEPATH . '/searchform.php'); ?> <?php endif; ?>
I’ve read this page https://codex.www.ads-software.com/Template_Tags/query_posts#Usage_Note
but I still dont understand what to erase from my code, where to put query_posts($query_string to make pagination work correctly.Please help
- The topic ‘Where to insert query_posts($query_string in category.php?’ is closed to new replies.