Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Greg Ross

    (@gregross)

    No, we don’t support wp_query.

    Thread Starter jaavid

    (@jaavid)

    🙂

    global $wpdb;
    $results = $wpdb -> get_results('SELECT wp_statistics_pages.id
    FROM wp_statistics_pages
    JOIN wp_posts
    ON wp_posts.ID = wp_statistics_pages.id
    WHERE wp_posts.post_type = 'publication'
    GROUP BY id
    ORDER BY count
    DESC
    LIMIT 10', ARRAY_A );
    
    $args = array(
    'post_type'  => 'publication',
    'post__in'  => $results,
    'orderby'   => 'post__in'
    );
    $query = new WP_Query( $args );
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘statistics in loop’ is closed to new replies.