Custom post type order by post_count

Question

Im trying to order by post_count DESC but custom_post_type not working

function post_count_type($role, $number) {
$args = array(
    'post_type'     => array( 'custom_post_type' ),
    'orderby'       => 'post_count',
    'order'         => 'DESC',
    'role'          => $role,
    'number'        => $number
);
$users = get_users( $args );
$the_query = new WP_Query( $args );
    foreach ($users as $user) {
    echo 'html here...';
    }

}

Sorry for my english.

0
Fayens 2 years 2019-11-03T15:26:06-05:00 0 Answers 81 views 0

Leave an answer

Browse
Browse