• Hello!
    I have problem with set up “posts per page” when I use “WP Page Numbers” plugin.
    I use that code to specify how many posts I want to display on specific category:

    <?php
    global $query_string;
    parse_str( $query_string, $args );
    if (is_category('blog')){
    $args['posts_per_page'] = 5;
    query_posts($args);
    }
    ?>

    When I change page number for “NEXT” there is shown text: “Nothing found”
    Can anybody help with this problem?
    How to set-up “posts per page”, when use this plugin?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter enimatto

    (@enimatto)

    any idea?
    Why pagination “doesn’t see” next posts?

    Thread Starter enimatto

    (@enimatto)

    One more thing.
    when I use this code:

    <?php
    global $query_string;
    parse_str( $query_string, $args );
    if (is_home()){
    $args['posts_per_page'] = 5;
    query_posts($args);
    }
    ?>

    works perfect.
    but as you see, only for home page.
    There is no problem with display next posts.
    Only when I use “if (is_category..” there is problem.

    I had this problem a few months back. Check this thread (last post), I hope it helps you out.

    Thread Starter enimatto

    (@enimatto)

    Thank you for some clues.

    I made something like this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts(array(
    'cat' => '9',
    'posts_per_page' => '1',
    'paged'=>$paged,
    ));

    Pagination seems to work, but I have on every category posts from only the one category: ID 9.

    If I use:

    if (is_category(array('9')) ) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts(array(
    'cat' => '9',
    'posts_per_page' => '1',
    'paged'=>$paged,
    ));
    }

    then every category displays adequate posts. When we go to category ID 9, then we have of course right pagination at bottom, 1 post per page, like settings above.. But when I click for example “next page” or “page 2” or “page 3”
    then I have still no posts – Nothing Found.

    Any idea what is wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin "WP Page Numbers" VS "posts_per_page"’ is closed to new replies.