prepare(" SELECT post_author, COUNT(*) as post_count FROM $wpdb->posts WHERE post_type = %s AND post_status = 'publish' GROUP BY post_author ORDER BY post_count DESC LIMIT %d, %d ", $post_type, $offset, $per_page); $author_posts = $wpdb->get_results($query); wp_cache_set($cache_key, $author_posts, 'adqs_cache'); } // Caching the total author count query $total_authors_cache_key = "adqs_all_agents_total"; $total_authors = wp_cache_get($total_authors_cache_key, 'adqs_cache'); if ($total_authors === false) { $total_authors = $wpdb->get_var($wpdb->prepare(" SELECT COUNT(DISTINCT post_author) FROM $wpdb->posts WHERE post_type = %s AND post_status = 'publish' ", $post_type)); // Set the cache with a timeout of 1 hour (3600 seconds) wp_cache_set($total_authors_cache_key, $total_authors, 'adqs_cache'); } if (!empty($author_posts)) : do_action('adqs_before_main_content'); ?>
post_author ?? 0; $author = get_userdata($author_id); $author_posts_url = adqs_listing_author_url($author_id, $post_type); $Helper = AD()->Helper; $review_ratings = $Helper->get_author_ratings($author_id); $review_count = $Helper->get_author_review_count($author_id); $review_text = (1 < (int) $review_count) ? esc_html__('Reviews', 'adirectory') : esc_html__('Review', 'adirectory'); ?>
'fa-facebook', 'adqs_twitter_profile' => 'fa-twitter', 'adqs_instagram_profile' => 'fa-instagram', 'adqs_linked_profile' => 'fa-linkedin', ]; $authroSocials = array_filter($authroSocials, function ($key) use ($author_id) { return get_user_meta($author_id, $key, true) ? true : false; }, ARRAY_FILTER_USE_KEY); if (!empty($authroSocials)) : ?>
1) : ?>