orderby=meta_value_num creates duplicate posts

I have my facebook likes stored in a custom field named fb_likes. my wordpress post order is sorted by this field, like this. ‘meta_key’ => ‘fb_likes’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, ‘ignore_sticky_posts’ => 1, ‘posts_per_page’ => $wp_query->get(‘posts_per_page’), ‘paged’ => $paged This seems to work fine at first glance, but if you click through the … Read more

Custom Post order for homepage

I would like to display a dropdown on the homepage which contains [most popular, most recent, trending] and when a user selects on of them the posts are page reloads and the posts are sorted in that order. Right now I am using query string to detect the sort order. For eg: http://example.com/?sort=popular or http://example.com/?sort=trending. … Read more

Display custom post types with custom date field value (before today) & order by custom date field

I’m trying to display custom post types with custom date field value being before today. It works OK for showing posts before today, but the order is only based on post date. I want to have the result ordered by meta_key. I tried the following code and I don’t understand why it doesn’t work: query_posts( … Read more