Try it with this:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("posts_per_page=4&cat=1&paged=".$paged); ?>
hmm, still not working.. see for yourself – http://banburywalker.com/site/labs/
and scroll to bottom – click on older posts..
If this is a static front page use:
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
query_posts("posts_per_page=4&cat=1&paged=".$paged);
?>
Thanks for your help.
Yes it’s a custom template – home.php, using a page within WordPress.
The code you have supplied is not working for me. Syntax error line 25:
[Code moderated as per the Forum Rules. Please use the pastebin]
You’re missing the start of the loop.
try changing this:
<?php if ( have_posts() ) : ?>
<?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; } query_posts("posts_per_page=4&cat=1&paged=".$paged); ?>
to this:
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
query_posts("posts_per_page=4&cat=1&paged=".$paged);
?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
superb! worked thank you!
You’re welcome. Glad you got it resolved.
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
How to add pagination in above code .
Anyone can help me about that ?
Please post your own topic and do read the Forum Rules before posting code.