WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
Sort by Favorite post in WP query (2 posts)

  1. oomskaap
    Member
    Posted 11 months ago #

    I have the below WP query to oepn a page and sort items by "sales count"
    I would like to modify this query and replace it to work with Wp Favorite Posts. Essentially sorting it from most favorite post.

    <?php
    $cat_id='-8';//the category ID
    $limit = get_option('posts_per_page');
    
    query_posts(array(
    'showposts'=>32,'more' => $more = 0,
    'orderby'  => 'meta_value',
    'meta_key' => 'sales_count',
    'order' => 'DESC',
    ));?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Which values do I have to enter above for it to work?

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. oomskaap
    Member
    Posted 11 months ago #

    Solution:

    <?php
    $cat_id='-8';//the category ID
    $limit = get_option('posts_per_page');
    
    query_posts(array(
    'showposts'=>32,'more' => $more = 0,
    'orderby'  => 'meta_value',
    'meta_key' => 'wpfp_favorites',
    'order' => 'DESC',
    ));?>

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.