Support » How-To and Troubleshooting » [Resolved] Query_posts loop and pagination

[Resolved] Query_posts loop and pagination

  • Hello everyone!!!!

    I have here this index.php

    <?php get_header(); ?>
    <div id="centerpiece">
            <div id="boxmodel-top">
                    <?php if (!is_single()) : ?>
                    <div id="boxmodel">
                            <div id="content-sticky">
                                            $category = get_the_category(''); $cat_slug = $category[0]->category_nicename;
                                            if (have_posts()) : while (have_posts()) : the_post();
                                                    echo '<div class="category_description">'; if (in_category('24')) the_content(); echo '</div>';
                                            endwhile; endif; wp_reset_query();
                    <?php else : ?>
                    <?php endif; ?>
                    <div id="boxmodel_main">
                            <div id="content">
                                    if (!is_single()) :
                                                    'category__not_in' => array(24, 44),
                                    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                                            <?php if (in_category("24") || in_category("44")) continue; ?>
                                            <div class="post" id="post-<?php the_ID(); ?>">
                                                    <div class="post-head">
                                                            <div class="post-blocktitle">
                                                                    <h2 class="post-title"><a href="<?php the_permalink(); ?>" class="post-title" rel="bookmark"><?php the_time('d.m.Y') ?>&nbsp;-&nbsp;<?php the_title(); ?></a></h2>
                                                    <div class="post-contents">
                                                            <div class="post-content"><?php the_content('Continua...&raquo;'); ?></div>
                                                    </div><!--[post contents]-->
                                            </div><!-- [post] -->
                                    <?php endwhile; ?>
                                            <div class="navigation">
                                              <span class="previous-entries"><?php next_posts_link('Articoli precedenti...') ?></span><span class="next-entries"><?php previous_posts_link('Articoli successivi...') ?></span>
                                    <?php else : ?>
                                            <span class="center">Mi dispiace, ma non sono presenti articoli in questa pagina.</span>
                                    <?php endif; ?>
                    </div><!-- [box model] -->
            <?php get_sidebar(); ?>
    </div><!-- [centerpiece] -->
    <?php get_footer(); ?>

    and since I don’t use the single page but templates and when I write posts I associate them to categories (except categories 24 and 44 which are only for sticky boxes) which are shown by template pages, but at home page when I click on previous entries (“Articoli precedenti” in the code) or next entries (“Articoli successivi” in the code) it doesn’t shown other posts, looks like it shows same posts…
    Any suggest would be really appreciated…

    Thanks in advance to everyone!!

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Query_posts loop and pagination’ is closed to new replies.
Skip to toolbar