I have three sections:
1-New posts 2-Trending posts 3-Hot Posts
I'm using a Vote plugin and i sort every section like this:
New Posts:
$args = array(
'meta_query'=> array(
array(
'key' => '_wti_like_count',
'compare' => '<=',
'value' => 5,
'type' => 'numeric',
'posts_per_page' => 5
) ) );
query_posts( $args );
The result of this is:
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND wp_postmeta.meta_key = '_wti_like_count' AND wp_postmeta.meta_value <= '5' GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 100
On this section only the posts from 0 to 5 Votes are displaying.
Once it Reach 6 Votes .. It goes to the Trending section ->
$args = array(
'meta_query'=> array(
array(
'key' => '_wti_like_count',
'compare' => '>=',
'value' => 5,
'type' => 'numeric',
'posts_per_page' => 5
) ) );
query_posts( $args );
Where posts between 5 or more... are displaying an so on...
My problem its that i ORDER them BY wp_posts.post_date and once an old posts get more votes than a new one it goes from News Posts to Trending Posts but it doesn't display on TOP of the Section... It goes below..
I wan't to be able to do something like this..
$args = array(
'meta_query'=> array(
array(
'key' => '_wti_like_count',
'compare' => '<=',
'value' => 5,
'type' => 'numeric',
'posts_per_page' => 5
) ) );
query_posts( $args );
when it reach to 6 votes... I want to be able to update the wp_posts.post_date to current so like that every time an old post receive more than 5 votes .. it shows first in the trending section... not below
something like if 'value' = 6 update wp_posts.post_date to current?