Нужно вывести на главную несколько таких блоков подряд.
Помогите отредактировать код, чтобы 1-я новость с картинкой не повторялась в списку ниже.
Код:
<div class="post">
<h3 style="color:#CC0000;">ТОП 20-ка</h3>
<?php $args = array( ‘posts_per_page’ => 1, ‘post__in’ => get_option(‘sticky_posts’), ‘ignore_sticky_posts’ => 1 ); query_posts($args); ?>
<?php $news = get_posts(‘category=3&numberposts=1’); ?>
<?php foreach ( (array) $news as $post ) : setup_postdata($post); ?>
<a href="http://localhost/wp/?cat=3" title="<?php the_title(); ?>">
<img style="background:#ffffff; margin: 3px 15px 0px 0px; padding:4px; border: 1px double #e6e6e6; " src="<?php bloginfo(‘stylesheet_directory’); ?>/timthumb.php?src=<?php echo catch_that_image(); ?>&h=150&w=180&q=75&zc=1" width="80" height="60" alt="<?php the_title(); ?>" align="left" /></a>
<a href="<?php the_permalink(); ?>"><span class="title" style="color:#1C56A5;"><?php the_title(); ?></span></a>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<br />
<?php $news = get_posts(‘category=3&numberposts=2’); ?>
<?php foreach ( (array) $news as $post ) : setup_postdata($post); ?><br />
<a href="<php the_permalink(); ?>">• <?php the_title(); ?></a>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
</div>
Up