• I’m new to WP, so maybe this is expected, but it seems weird to me that using query_posts before get_query_var seems to not work correctly.

    This code:

    query_posts('posts_per_page=-1');
    $nn_lat = get_query_var('nn_lat');
    $nn_lon = get_query_var('nn_lon');

    always returns the empty string from get_query_var while this code

    $nn_lat = get_query_var('nn_lat');
    $nn_lon = get_query_var('nn_lon');
    query_posts('posts_per_page=-1');

    works correctly.

    Is that the intended behavior?

The topic ‘query_posts() clobbers get_query_var()’ is closed to new replies.