Created
June 23, 2014 13:16
-
-
Save pascalmaddin/6a4c0d523b48e9a05ef6 to your computer and use it in GitHub Desktop.
WordPress: get posts from category (including some args)
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
query_posts( array( 'category__and' => array($cat_id), 'posts_per_page' => 1, 'orderby' => 'rand' ) ); | |
while (have_posts()) : the_post(); | |
// show stuff here | |
endwhile; | |
wp_reset_query(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment