• 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 page

    but 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)
  • Thread Starter fumocamel

    (@fumocamel)

    i change
    Blog pages show at most
    in settings->Reading section in back end

    and works

    but if i need another category page
    how to set how many posts per page?

    thanks

Viewing 1 replies (of 1 total)
  • The topic ‘how to use paged in category-{slug}.php’ is closed to new replies.