Created
August 18, 2016 08:14
-
-
Save mzo84/59a1fd275c1159ebe996f29819627645 to your computer and use it in GitHub Desktop.
Wordpress - listing random possts
This file contains 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
<?php // display random posts | |
$home_brew = new WP_Query('showposts=3&orderby=rand'); | |
while($home_brew->have_posts()) : $home_brew->the_post(); | |
// output custom stuff here! Post title, content, custom elds.. | |
endwhile; | |
wp_reset_postdata(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment