Articles of plugin wp pagenavi

How do I sort posts with multiple pages

I am using a drop-down to sort posts by title, meta_value, etc. However, the sorting feature only works on the first page. The second page displays the default order rather than continuing the order from page 1. I am using wp-pagenavi for pagination. Any ideas what would be causing this error? Here’s a link to […]

Page navigation doesn't show when query category

Problem: when I do www.example.com?cat=4 or choose category through custom menu or from category widget it shows only first page without navigation at the bottom, where it supposed to be. It’s the same if I use index.php or category-slug.php as template. For test, when I do www.example.com?year=2012 it works. Also, www.example.com?cat=4&paged=2 works. So it must […]

Exclude Sticky posts from Main Query break Pagination

I have a small problem with this function ! I would like to exclude all sticky post from my query but when I do it, it breaks my pagination. In the following code, when I remove the “‘post__not_in’ => $sticky” my pagination works like a charm… Any advice would be much appreciated ! Cheers. /* […]

Pagination is not working on single-{slug}.php but works fine on page-{slug}.php

I would like to have my single-{slug}.php perform a query on a list of posts from different custom post type and use pagination. The pagination appears but unfortunately, clicking the pagination does not go to that page and always remains on page 1. Currently using WP-navi, btw. Example: Load the list of post from single-sports.php […]

How To create ajaxed wp-pagenavi?

I’m using WordPress as a Facebook platform and have a page that shows posts from 2 different categories. Each category has it’s own pagination using wp-pagenavi. In order to stay in Facebook I need the pagination links to load using ajax. I’ve seen this article which gives a nice clue about it, but would love […]

wp_pagenavi() with custom wp_query()?

<?php /* Template Name: Projects */ ?> <?php get_header();?> <section id=”content”> <section id=”main”> <?php $loop = new WP_Query(array(‘post_type’ => ‘projects’, ‘posts_per_page’ => 4)); $i=1; while ( $loop->have_posts() ) : $loop->the_post(); ?> <article class=”post<?php if($i%2 == 0) { echo ‘ right’; }; $i++; ?>” id=”post-<?php the_ID(); ?>”> <h2><?php the_title(); ?></h2> <section class=”entry”> <?php the_excerpt(); ?> </section> […]

How can I make wp-pagenavi work on a custom query built upon a form submission?

I’ve also posted this on the wordpress support forums, for scribu’s wp-pagenavi plugin: http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1 My situation: I am using a form to create a custom query that displays posts from a custom post type archive matching a certain custom field (Eg: For “custom-post-type” show only posts that have the “custom-field” value selected from the form). […]

How to determine if I'm on the first page of pagination?

How do I determine if I’m on the very first page of pagination? I’m using WP_Pagenavi. I want to run a function only on the first page of the pagination. I checked the query_var ‘paged‘, it’s set to 0 on this page, and then 2, 3 and so on in the later pages (1 is […]