try to change this:
'paged' => get_query_var('paged')
into this:
'paged' => get_query_var('page')
(as far as can see, it is not totally clear what to use)
http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters
Show Posts from Current Page
Display posts from current page:
$query = new WP_Query( 'paged=' . get_query_var( 'page' ) );
Pagination Note: You should set get_query_var( 'page' );
if you want your query to work with pagination. Since WordPress 3.0.2, you do get_query_var( 'page' )
instead of get_query_var( 'paged' )
. The pagination parameter ‘paged’ for WP_Query() remains the same.
thanks for the reply alchymyth,
unfortunately it still didnt solve the problem.. also to test the change i did the following
<?php echo "PAGE: ".get_query_var('paged'); ?>
and
<?php echo "PAGE: ".get_query_var('page'); ?>
the result was
PAGE: 0
and
PAGE:
so i have left it as paged as it seems to result in an output at least..
this is still linking back to the homepage on clicking any of the links :S
im thinking that maybe buddypress is doing something messed up to the code… im just surprised as if it was going to link to a page that doesnt exist then i should get a 404 error not a redirect :S
there doesnt appear to be a page redirect call in the .htaccess or the header.php file
so confused
ok.. more things to add to this as its now getting rather confusing
the page url where the pagination is wanting to occur looks like this
http://mydomain.com/members/username/posts/
now i have found no matter what i type after this url it ALWAYS redirects me to the home page UNLESS there is actually another page there..
ie:
http://mydomain.com/members/username/posts/asdafasf/
REDIRECTS TO HOMEPAGE
but
http://mydomain.com/members/username/posts/new/
stays on the new page because it exists..
now because pagination with pagenavi uses the link below to change which page its on the blog is automatically redirecting me
http://mydomain.com/members/username/posts/page/2/
is there a way to stop this from happening?
at the minute im having to code a work around using get data.. which doesnt force the redirect..
Anonymous User 8099256
(@anonymized-8099256)
Hi,
I had the same problem here but, the issue has something to do with the setting that you will find here “Seetings > Reding > Blog pages show at most > Type the number that you need“
I have a paged query that is not working even though I have set everything correctly, but the issue I guess is the global variables of maximum posts per page that overrides the “posts_per_page” variable from the “query_posts”.
Hope this works,
Mugur
Anonymous User 8099256
(@anonymized-8099256)
Little update here: it has nothing to do with the permalink structure.
I was trying to add pagination to my plugin; http://wordpress.org/extend/plugins/bp-posts-on-profile/
and i had the same problem… on buddypress page like profile page get_query_var(‘page/paged’) don’t work correctly.
So I found $bp->action_variables, now it works with code like this;
<?php
if (!$page = intval(get_query_var(‘paged’))) {
global $bp;
$page = intval($bp->action_variables[0]);
}
?>