how to use paged in category-{slug}.php
-
hi,
i do a category-{slug}.php page called category-writing.php
with this code$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => 1, 'category_name' =>writing, 'orderby' => title, 'order' => DESC, 'paged'=>$paged ); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); $post_id_image=$post->ID; the_content(''); previous_posts_link(); next_posts_link();
the first page work
https://mywebsite.com/category/projects/writing/
i need 1 post per pagebut when i click to next post
i got this link
https://mywebsite.com/category/projects/writing/page/2/but i get the index.php not my category-writing.php
what’s wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how to use paged in category-{slug}.php’ is closed to new replies.