Jump to content
Sign in to follow this  
clickmode

Pagination not working on home

Recommended Posts

clickmode

The pagination (platform pro) is not working on the home page (blog). However it works on the category pages. The pagination links change the url to /page/2/.../page/3/ etc. but the content does not cycle and the pagination numbers do not change from 1. I have deactivated pagenavi and the same result with the wordpress next and previous posts. Url change but the content does not. The template setup has a sidebar above the main content. Took that out and the same result. Again only on the home page and not the category pages. Help please! Looked everywhere, tried some code changes... no avail. Launching this weekend and need this fixed!

Share this post


Link to post
Share on other sites
clickmode

Ive been playing around and have isolated the problem. Its in the template.postloop.php file. I added this:

	if(is_home()) query_posts('category_name=Articles');
below this:
$paged = intval(get_query_var('paged'));
	
if(is_admin()) query_posts('showposts=1'); 
I need to get home to display only one category. How do I do this so that the pagination doesnt break? Forums are saying to write this:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=Articles&paged=$paged");

Problem with that is it results in clicking on the single post link returning the post url but displaying the category loop. Any clues?

Share this post


Link to post
Share on other sites
Kate

Hey Cory - At first glance this appears like it should work fine. Quick question: Could you clarify what you mean by this:

Problem with that is it results in clicking on the single post link returning the post url but displaying the category loop.
Also: do you have a link, please?

Share this post


Link to post
Share on other sites
clickmode

When the code that I put in there is present clicking on the post link that goes to the single post page just returns an array of the post archive the same as the home page. What did this was changing this:

$paged = intval(get_query_var('paged'));
To this:
$paged = intval(get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=Articles&paged=$paged");

Build site: http://liquid-dollhouse.com/wp-build/ I realize I dont know exactly what that line of code is doing exactly but Im trying to figure it all out.I have since installed a plugin that solves it but I would really like to crack the code on how to write it myself so that it works. Plugins are great but I want to learn the correct syntax.

Share this post


Link to post
Share on other sites
cmunns

from the WP docs on query_posts

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 query_posts() remains the same.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×