проблема с выводом постов

Добрый день!
Решил вставить вверху главной страницы блок который выводит по пять последних новостей в столбик, из двух категорий
но возникла проблема, на главной слали отображатся всего 5 постов из одной категории, те которые отображаются в этом блоке.
вот такой код:

<div>
            <div class="hr_top"></div>
            <div class="column_left_b"> 
                <?php query_posts('showposts=1&cat=15'); ?>
                <?php while (have_posts()) : the_post(); ?>
                <h2><?php the_category(', '); ?><i> - <?php the_time('M j, Y G:i'); ?> - <a href="<?php the_permalink() ?>#commenting" title="Jump to the comments"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></i></h2>
                <h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
                <?php the_content('Continue...'); ?>
                <?php endwhile; ?>
                <?php query_posts('showposts=5&offset=1&cat=51'); ?>
                <h2><?php single_cat_title(); ?></h2>
                <ul>
                <?php while (have_posts()) : the_post(); ?>
                <li><span class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
                    <br />
                    <span class="meta"><?php the_time('l, F j, Y G:i'); ?> - <a href="<?php the_permalink() ?>#commenting" title="Jump to the comments"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></span></li>
                    <?php endwhile; ?>
                </ul>
                                
            </div> 
                        
            <div class="column_left_b">
                <?php query_posts('showposts=1&cat=11'); ?>
                <?php while (have_posts()) : the_post(); ?>
                <h2><?php the_category('1'); ?><i> - <?php the_time('M j, Y G:i'); ?> - <a href="<?php the_permalink() ?>#commenting" title="Jump to the comments"><?php comments_number('0 Комментариев','1 Коментарий','% Комментариев'); ?></a></i></h2>
                <h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
                <?php the_content('Continue...'); ?>
                <?php endwhile; ?>
                <?php query_posts('showposts=5&offset=1&cat=7'); ?>
                <h2>Новая <?php single_cat_title(); ?> </h2>
                <ul>
                    <?php while (have_posts()) : the_post(); ?>
                    <li><span class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
                    <br />
                    <span class="meta"><?php the_time('l, F j, Y G:i'); ?> - <a href="<?php the_permalink() ?>#commenting" title="Jump to the comments"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></span></li>
                    <?php endwhile; ?>
                </ul>
                
                </div>
            <div class="hr_bottom"></div><br/>
        </div>

в чем может быть причина?

Наверно, после самодеятельности нужно сделать query_posts с теми параметрами, которые были при входе на страницу.

вставил query_posts – посты стали отображатся нормально, но перестал работать pagenavi.

Перед "самодеятельностью" надо сохранить $query_string, а после скормить сохраненное значение query_posts.

Спасибо огромное разобрался, вроде работает.

Anonymous
Отправить
Ответ на: