Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
  2. <?php
  3.  
  4. // args
  5. $args = array(
  6. 'numberposts' => -1,
  7. 'post_type' => 'page',
  8. 'meta_key' => 'feature_on_front_page',
  9. 'meta_value' => 'featured'
  10. );
  11.  
  12.  
  13. // query
  14. $the_query = new WP_Query( $args );
  15.  
  16. ?>
  17. <?php if( $the_query->have_posts() ): ?>
  18. <ul>
  19. <?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
  20. <li>
  21. do some stuff
  22. </li>
  23. <?php endwhile; ?>
  24. </ul>
  25. <?php endif; ?>
  26.  
  27. <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
  28.  
  29. 'meta_value' => array('Featured' => 'featured')
  30.  
  31. 'meta_value' => array('featured')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement