get_results( $wpdb->prepare( "SELECT s.id, s." . getSpeciesLangCol() . " as species_name, COUNT(*) as total FROM {$wpdb->postmeta} pm LEFT JOIN species s ON pm.meta_value = s.id LEFT JOIN {$wpdb->posts} p ON pm.post_id = p.id WHERE p.post_author = %d AND pm.meta_key = 'species_id' AND pm.meta_value <> 0 GROUP BY pm.meta_value ORDER BY s." . getSpeciesLangCol() . " ASC", $userId ), ARRAY_A ); if ($speciesList) : echo "

" . count($speciesList) . " " . __("species photographed") . "

"; echo ""; echo ""; echo ""; foreach ($speciesList as $species) { echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
" . __("Species") . "" . __("Count") . "
" . esc_html($species['species_name']) . "" . $species['total'] . "
"; else : echo "

" . __("No species photographed") . "

"; endif; elseif ( $wp_query->have_posts() && count($uniqueposts)) : echo "

" . $wp_query->found_posts. ' ' . __("results found") . '


'; /* Start the Loop */ while ( $wp_query->have_posts() ) : $wp_query->the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ //if (get_the_post_thumbnail()) { get_template_part( 'template-parts/post/content', get_post_format() ); //} endwhile; the_posts_pagination( array( 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', ) ); else : _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyseventeen' ); endif; } else { ?>