I tried that and is not working… any other idea?
have you checked how to use the ‘paged’ parameter, for instance?
without seeing what you have coded, there is not much else to suggest than to read the codex.
for more suggestions, please paste the full code of the template into a http://pastebin.com/ and post the link to it here.
also, a link to your site might help to illustrate your problem.
Thanks for answering, I’ve been fighting the code over a week…
The tempalte has a loop page called layout.php that is called from the index page, As you can see here the pagination works fine
I’m trying to have the same code called from the single posts pages like this but the pagination doesn’t work.
The code I’m using in the single posts are:
Here is the code
[Code moderated as per the Forum Rules. Please use the pastebin]
make sure to use straight quotes ('
) in your code – possibly through copy/paste you have these kind of quotes (‘ ’
) which will not work.
try:
http://pastebin.com/RV4PkjnV
No the quotes are ok… but still doesn’t work..
I also tried different pagination plugins and the error persists.
It won’t access the “page 2” like this
http://www.rotatingplanet.com/rotatin/2011/01/05/the-uluit/page/2/
the last link is of a single post – and I couldn’t find a pagination link on that web page.
is that one of your problems?
I’m trying to use the loop that is located in layout.php in another page (inside single.php),
can you paste the full code of single.php into a http://pastebin.com/ and post the link to it here?
I was trying different things… now the pagination is there, and this is the link of the code
http://pastebin.com/a6i44nc9
thanks for your help
this section is a bit odd – you are not actually putting anything out:
query_posts( array( 'cat' => 61, 'paged' => get_query_var('paged') ) );
while ( have_posts() ) : the_post();
endwhile;
are these codes supposed to be in the loop?
<?php if( empty($option['trt_lay'])) { ?>
<?php get_template_part('layout1');?>
<?php }?>
<?php if($option['trt_lay']== "Layout 1") { ?>
<?php get_template_part('layout1');?>
<?php }?>
what is the code of layout1.php?
The layout is he loop that is called in the index.php it was originally in the theme
Here it is the code
http://pastebin.com/NpjjNX83
that could be the problem – the layout1.php has the full loop, and you are running also a loop with your custom query;
try to change this section:
<?php
query_posts( array( 'cat' => 61, 'paged' => get_query_var('paged') ) );
while ( have_posts() ) : the_post();
endwhile;
?>
to:
<?php
query_posts( array( 'cat' => 61, 'paged' => get_query_var('paged') ) );
global $wp_query; //possibly needed?//
?>
you might also need to make $wp_query global;
also add this in line 1 of layout1.php:
<?php global $wp_query; ?>
MMM, no, nothing change… still the pagination won’t work.