Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDanijel Salijević
8,120 PointsMost popular post
Hi, can someone help me to set up arguments to display most popular ( most readed )posts.
I use code arguments bellow but is not displaying anything. Mybe I need something to turn on that this code works propetly?
$args=array( 'post_type'=>'post', 'cat'=> -1 , 'meta_key'=>'post_views_count' , 'orderby' => 'meta_value_num' , 'posts_per_page' => 3 );
Thank you in advance
1 Answer
Danijel Salijević
8,120 PointsYes, sure. But I think that problem is in arguments list . I know that this can be made with plugin, but this is not solution that I'm looking for.
Ben Singer
8,621 PointsBen Singer
8,621 PointsHI Danijel,
Have you added the WordPress loop using the WP_Query($args) object?
The $args array doesn't do anything by itself.