[Solved] WordPress have_pots() returning 1


Here’s how I would do it:

$total_posts = wp_count_posts(); /* Returns the number of posts */

echo $total_posts->publish; /* Prints the number of published posts */

EDIT:

Based on our conversations below, here’s the answer you were looking for:

$articles = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => -1)); 

while ($articles->have_posts()): $articles->the_post(); 
    echo the_title; 
    echo the_excerpt; 
    echo the_tags; 
    echo the_date;      
    echo the_category(); 
endwhile;

10

solved WordPress have_pots() returning 1