jeudi 1 janvier 2015

Best approach to create Hot and Trending sections


I am going to implement a Hot and Trending section on a website. I have seen such sections on many popular websites but can't really figure out how exactly this works.


Although I assumed Hot section is most popular posts (based on post views) which I developed by a custom WP_Query. And it works.



$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'meta_key' => 'post_views',
'orderby' => 'meta_value_num',
'ignore_sticky_posts' => 1,
'paged' => $paged,
);
$hot_query = new WP_Query( $args );


But I am stuck on Trending section. What exactly is the idea behind it for creating a custom query.


I want to know what is the best approach to get content in each section. I tried searching on Google for couple of days but could not really find anything useful.





Aucun commentaire:

Enregistrer un commentaire