Created
September 21, 2016 14:39
-
-
Save jpen365/7a13478d695a4fc41664a3a4be046863 to your computer and use it in GitHub Desktop.
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
<?php | |
$args = array( | |
'post_type' => 'post', | |
'cat' => '94', | |
'meta_key' => '_custom_post_order', | |
'orderby' => 'meta_value', | |
'order' => 'ASC' | |
); | |
$query = new WP_query ( $args ); | |
if ( $query->have_posts() ) { | |
while ($query->have_posts() ) { | |
$query->the_post(); | |
/* only list posts that have a current custom post order value */ | |
if ( !empty(get_post_meta( $post->ID, '_custom_post_order', true )) ) : ?> | |
/* insert code for rendering posts */ | |
<?php | |
endif; } | |
wp_reset_postdata(); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment