Created
March 3, 2013 21:30
-
-
Save Shelob9/5078389 to your computer and use it in GitHub Desktop.
Show wordpress posts in arbitrary order. Best for category page.
Problem solves, as always, on WordPress Answers
http://wordpress.stackexchange.com/questions/89148/how-to-order-posts-in-an-arbitrary-order
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 | |
$custom_query = new WP_Query(array( | |
'post__in' => array(4, 9, 12 /* whatever your post ID's are here */), | |
'orderby' => 'post__in', | |
)); | |
while ($custom_query->have_posts()) { | |
$custom_query->the_post(); | |
get_template_part( 'content', get_post_format() ); | |
} | |
foundation_pagination(); | |
// restore the original query | |
wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment