Support » Plugins and Hacks » $max_num_pages is always empty

  • Pospiech

    (@pospiech)


    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?

  • The topic ‘$max_num_pages is always empty’ is closed to new replies.