Hot answers tagged plugin-wp-pagenavi
4
You can try implementing ajax based pagination for wp-pagenavi plugin(see http://wordpressapi.com/2011/05/16/add-ajax-pagination-in-wordpress-blog/ for reference ). I think this will solve your issue.
2
if you only want to know that you are on the first page of a paginated page, try:
if( !is_paged() ) {
//first page of pagination
}
http://codex.wordpress.org/Function_Reference/is_paged
1
You're initially submitting a POST request via a form with the sort parameters. When you click links to additional pages, you're just sending a GET request for the next page without those original POST vars, so they don't carry over to the additional pages and aren't picked up by your if(isset($_REQUEST['sort'])). Probably the simpler way to handle it is to ...
1
Here are the solutions I found (note I'm using WP 3.3.2 and WP-Pagenavi 2.82):
Solution 1: Using paged instead of page as a get_query_var parameter.
Solution 2 Using ajax based navigation, just as in the article swtshweta pointed out.
(using Ajax, pagination works properly even with the page parameter).
1
try to do the following in /layouts/default.php (and /layouts/blog.php):
change the query line (line 5) to:
wp_reset_query();
$paged = (get_query_var('paged')) ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1 );
$the_query = new WP_Query('cat=-'. $GLOBALS[ex_feat] . ',-' . $GLOBALS[ex_vid] . '&showposts=' . ...
1
you are quering the same posts over and over, and that is way you are getting the same posts, to fix it just add
'paged' => get_query_var('paged') to your query arguments, so change:
<?php $portfolioloop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => 12 ) ); ?>
into:
<?php $portfolioloop = new WP_Query( array( ...
1
Probably the problem has been already solved here: http://stackoverflow.com/a/13216165/1801379
You ca also get some idea from here: http://wordpress.stackexchange.com/a/4131/23290
1
I took a look at the index.php code and I'll explain what's going on.
The theme author is using 2 custom new WP_Queries but is not doing anything with the main global $wp_query object. When you click to the second page you get the same posts because there is no main loop present.
Neither of the secondary loops contain pagination parameters. To fix this ...
1
Why do you dont use the default functions from WP.
As example the follow class, there you can use.
class fb_pagination_example {
public function content_nav( $nav_id, $pag_bar = TRUE ) {
if ( $GLOBALS['wp_query'] -> max_num_pages > 1 ) : ?>
<nav id="<?php echo $nav_id; ?>">
<h1 ...
1
You need to do a little "hack" to get pagination to work for your custom loop.
After you define $loop, do the following:
<?php
// globalize $wp_query
global $wp_query;
// copy $wp_query into a temporary variable
$temp_wp_query = $wp_query;
// nullify $wp_query
$wp_query = null;
// move $loop into $wp_query
$wp_query = $loop;
?>
At this point, your ...
1
This could be a plugin compatibility problem. Have you tried to disable all plugins and see if that solves the problem?
I found this which may also be of help:
http://dre.im/if-pages-return-a-404-after-wordpress-3-1-upgrade/
Log in to wp-admin and go to permalinks, click save (this should refresh your permalinks).
Check to see if this fixes your ...
1
I was looking for a simple way to determine whether or not to use the posts_nav_link() function and all solutions I found online were either too complex or unreliable. For example, many people suggested using the $paged global variable, but I found that this variable returned the same value for the first page, even when the first page was the only page!
So, ...
Only top voted, non community-wiki answers of a minimum length are eligible