Last active
December 7, 2015 14:29
-
-
Save jayontraps/4f02be821cbcb3a6c153 to your computer and use it in GitHub Desktop.
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 | |
$args = array( | |
// arguments for your query | |
'post_type' => '', | |
'posts_per_page'=> -1, | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC' | |
); | |
// the query | |
$the_query = new WP_Query( $args ); ?> | |
<?php if ( $the_query->have_posts() ) : ?> | |
<!-- pagination here --> | |
<!-- the loop --> | |
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> | |
<h2><?php the_title(); ?></h2> | |
<?php endwhile; ?> | |
<!-- end of the loop --> | |
<!-- pagination here --> | |
<?php wp_reset_postdata(); ?> | |
<?php else : ?> | |
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment