Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array(
- 'post_type' => 'news',
- 'orderby' => 'meta_value_num',
- 'meta_key' => 'post_views_count',
- 'order' => 'DESC',
- 'numberposts' => '1',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'news',
- 'field' => 'news',
- 'terms' => array('news, deals, gossip, album-news, touring-news'),
- )
- )
- );
- $myposts = get_posts( $args );
- foreach( $myposts as $mypost ) : setup_postdata ( $mypost ); ?>
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <?php the_post(); ?>
- <?php endforeach;
- wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement