CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?php query_posts('cat=1&showposts=5&orderby=rand');
- if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div class="rand-news">
- <div class="name">
- <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
- </div>
- <div class="pic">
- <a href="<?php the_permalink() ?>"><?php if ( function_exists('get_the_post_thumbnail') && get_the_post_thumbnail($page->ID, 'thumbnail') ) { echo get_the_post_thumbnail($post->ID,array(74,74), true); } else {?> <img height="74" width="74" title="no image" alt="" src="<?php bloginfo('template_url') ?>/img/noimage.png" /></a>
- </div>
- <div class="anons"><?php the_excerpt_max_charlength(140); ?></div>
- </div>
- <?php endwhile; endif; wp_reset_query(); ?>