SHARE
TWEET

Untitled

a guest Feb 17th, 2015 186 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $args = array(
  3. 'post_type'    => 'news',
  4. 'orderby'      => 'meta_value_num',  
  5. 'meta_key'     => 'post_views_count',
  6. 'order'        => 'DESC',
  7. 'numberposts'  => '1',
  8. 'tax_query' => array(
  9. array(
  10. 'taxonomy' => 'news',
  11. 'field' => 'news',
  12. 'terms' => array('news, deals, gossip, album-news, touring-news'),
  13.                 )
  14.         )
  15. );
  16.  
  17. $myposts = get_posts( $args );
  18. foreach( $myposts as $mypost ) : setup_postdata ( $mypost ); ?>
  19.  
  20. <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  21. <?php the_post(); ?>
  22.  
  23. <?php endforeach;
  24. wp_reset_postdata(); ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top