//Displaying latest post per author on front page
function filter_where($where = '') {
global $wpdb;
$where .= " AND vipwp_posts.id = (select id from {$wpdb->prefix}posts p2 where p2.post_status = 'publish' and p2.post_author = {$wpdb->prefix}posts.post_author order by p2.post_date desc limit 0,1)";
return $where;
}
add_filter('posts_where', 'filter_where');
I would like to modify the code above: Is it possible change the order of the record from date by meta_value?
Example: CHANGE
order by p2.post_date
TO
meta_key='name_key' ORDER BY meta_value
Thanks, but if I remove post_where do not Displaying latest post per author