Ciao,
ho impiegato tante ore a cercare una soluzione al problema ma ancora non sono riuscito.
Vorrei visualizzare 10 post per pagina e poi grazie alla paginazione ottenere i post precedenti, ma cliccando sui link di paginazione ottengo invece sempre gli stessi post.
Questo è il mio codice:
Codice PHP:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('posts_per_page=10&paged=$paged');
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-recipes">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<h2 class="title-recipes"><?php the_title(); ?></h2>
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
?>
</a>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
Che utilizzi next_posts_link o altre funzioni non cambia nulla.
Qualcuno sa aiutarmi?
Grazie