Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wp_query count result

$args = array('post_type'   => 'post',
              'posts_per_page' => '4',
              'paged' => $pagination);
$posts = new WP_Query( $args );
echo $posts->post_count; // echo number of posts on query
// If you what to know if you arrived to pagination end then:
if ($posts->max_num_pages == $pagination) echo "You are on an end page"; 
 
PREVIOUS NEXT
Tagged: #count #result
ADD COMMENT
Topic
Name
2+4 =