wp_page_numbers plugin did not work
-
Here is my case:I have a php file
category-22.php
set up,and I use query_posts method to query the posts and wp_page_numbers plugin to page the posts.I wonder if there is anything wrong with my code,when i click the second page,the url(https://……/tutoriol/page/2)is right,but content still stay the first page,i searched the similar posts in the forum,it told me that my query_posts method should add get_query_var,so I add it in my code `<?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
query_posts(‘cat=22&offset=1&paged=$paged&posts_per_page=10’); ?>`,but It didn’t work,i tried every means i could,but the result still the same.I have my code attched,hope you can help me.I really thanks to you.<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=22&offset=1&paged=$paged&posts_per_page=10');?> <?php if(have_posts()):?> <?php while(have_posts()):the_post();?> <div class="listitem"> <h1><?php the_title();?></h1> <?php if(get_post_meta($post->ID,'topic_image','true')):?> <?php $image=get_post_meta($post->ID,'topic_image','true');?> <img src="<?php echo $image;?>" /> <?php else:?> <img src="<?php bloginfo('template_url')?>/custom_images/default.jpg" /> <?php endif;?> <?php the_excerpt();?>">[MORE] </div> <?php endwhile;?> <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?> <?php endif;?>
- The topic ‘wp_page_numbers plugin did not work’ is closed to new replies.