Visualizzazione 0 filoni di risposte
Visualizzazione 0 filoni di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Plugin e temi di WP › Paginazione wp restituisce sempre gli stessi post invece di andare ai successivi
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:
<?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">
" 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();
}
?>
</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
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0