Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $loop = new WP_Query( array(
- 'showposts' => 5,
- 'post_type' => 'eventdate',
- 'category_name' => X,
- 'orderby' => 'meta_value',
- 'meta_key' => 'CUSTOM-FIELD-NAME'
- )
- );
- while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <div>
- <h2><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- </div>
- <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement