[resolved] Request page number as integer (3 posts)

  1. Nukeface
    Posted 4 years ago #

    How would you get the page number currently being displayed? I need to display, say 10 posts per page (no problem) but the first two on the first page are to look different (no problem). But when I then open page 2, the first two posts on that page also look like the posts on page 1 (problem, as they aren't to be featured, old news).

    How would i go about doing this? Have tried is_page() without solution, end of the working day as well so only a quick post. Used standard method for getting posts as on the wp-pagenavi website (not wordpress.org)

    ` $my_query = new WP_Query( array( 'ID' => $post_range, 'order' => 'DESC', 'showposts' => '14', 'paged' => get_query_var('paged') ) );

    //the loop and more stuff
    //end loop

    wp_pagenavi( array( 'query' => $my_query ) );

    wp_reset_postdata(); // avoid errors further down the page


  2. scribu
    Plugin Author

    Posted 4 years ago #

    You're already using it: get_query_var('paged')

  3. Nukeface
    Posted 4 years ago #

    Pffff you're right, my bad, completely forgot that and tried to manipulate the pagination plugin... Good thing I can say it's friday afternoon! ;) Thx scribu

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic