Created
February 19, 2014 05:18
-
-
Save bizikov/9086435 to your computer and use it in GitHub Desktop.
Вывод случайных записей в wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="rand"> | |
<span>Случайные записи</span> | |
<?php $MyArgs = array('orderby' => 'rand','showposts' => '6'); ?> | |
<?php query_posts($MyArgs); ?> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
<div class="excerpt"> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> | |
<?php the_post_thumbnail(); ?> | |
<p class="title"><?php the_title(); ?></p> | |
</a> | |
</div> | |
<?php endwhile; endif; ?> | |
<?php wp_reset_query();?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment