Речь идет примерно об этом
<?php query_posts(‘showposts=4&cat=104,10,-139,-332’); ?>
похоже да, благодарю!
но в таком виде не выводит пока ничего:
<div id="content2" align="center">
<div class="content2" align="center"><?php query_posts('showposts=4&cat=4'); ?></div>
</div>
почему интересно
есть еще такая функция get_posts($args);
очень подойдет для этого случая массив аргументов:
$args = array(
'numberposts' => 5, 'offset' => 0,
'category' => 0, 'orderby' => 'post_date',
'order' => 'DESC', 'include' => '',
'exclude' => '', 'meta_key' => '',
'meta_value' =>'', 'post_type' => 'post',
'suppress_filters' => true
);
потом полученный массив можно распечатать в цикле
Благодарю — помогло 🙂 я правда чуть иначе нашёл решение:
<ul>
<?php $current_month = date('m'); ?>
<?php $current_year = date('Y'); ?>
<?php query_posts("cat=1,5&year=$current_year&monthnum=$current_month&order=ASC"); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if (in_category('3')) continue; ?>
<div class="post">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y'); ?></small>
<div class="entry">
<?php the_content(); ?>
</div>
<p class="postmetadata">Опубликованно в: <?php the_category(', '); ?></p>
</div>
<?php endwhile; else: ?>
<p>Пусто.</p>
<?php endif; ?>
</ul>
но думаю массив лучше будет смотреться, а как вы бы в цикле его представили?