Im successfully filtering my Porducts by a meta_key and its value. I display (query) the result in a custom page template. The query includes also a Pagination. Everything works fine - BUT sometimes after 3 to 5 page refreshes the query outputs some products twice - especially after calling the next page.
I figured out that the problem is caused by the 'orderby' => 'meta_value_num'
part of the following code. Any idea why this happens and any idea how to solve this problem?
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'meta_key' => '_recoed',
'meta_compare' => '>',
'meta_value' => '0',
'post_type' => 'product',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'paged' => $paged
);
query_posts($args);
get_template_part('index', 'most-liked-products');
The Part in my Page template looks like
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (isset($_GET['pnum']) && $_GET['pnum'] > 1) { $paged = 2; } //stop ads from repeating ?>
<?php
get_template_part('index-masonry-inc');
endwhile;
else :
?>
....
<?php endif; ?>