WordPress.org

Ready to get started?Download WordPress

Forums

$max_num_pages is always empty (1 post)

  1. Pospiech
    Member
    Posted 6 years ago #

    I have the following code in archive.php after the endwhile of the loop:

    $posts_per_page = intval(get_query_var('posts_per_page'));
    $paged = intval(get_query_var('paged'));
    echo "posts_per_page: ".$posts_per_page."<br/>";
    echo "paged: ".$paged."<br/>";
    echo "max_page: ".$wp_query->max_num_pages."<br/>";

    which outputs only the first and second value, but never the max_num_pages value.

    Why?

Topic Closed

This topic has been closed to new replies.

About this Topic