Querying Top posts of a Custom Post Type
-
Hello dear Huseyin and thanks for this super useful plugin.
Ratings for my custom post types work well, except when I want to query top rated ones of a post type.
The following code doesn’t acknowledge the favorite meta thingies. would you please help me with the code?<?php $custom_query = new WP_Query(array( 'post_type' => 'idea', 'post-meta' => 'wpfp_favorites', 'showposts'=>2, 'meta_key' => 'wpfp_favorites', 'orderby' => 'post-meta', 'order' => 'DESC', )); ?> <?php if (have_posts()): ?> <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?> <!-- Content Template --> <?php get_template_part( 'content', 'idea' ); ?> <!-- Content Template --> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php twentythirteen_paging_nav(); ?> <?php endif; ?>
–Thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Querying Top posts of a Custom Post Type’ is closed to new replies.