WordPress.org

Ready to get started?Download WordPress

Forums

forcing value of conditional tags doesn't work in 2.6.2 (1 post)

  1. pakistan1
    Member
    Posted 5 years ago #

    I have been using the method of manually setting the value of conditional tags like is_home after calling query_posts() in the sidebar, like this:

    query_posts('some_custom_query');
    
    $wp_query->is_home = true;
    $wp_query->is_category = false;
    $wp_query->is_archive = false;

    this doesn't seem to work in 2.6.2 anymore. is_category doesn't change its value. just to be sure:

    echo(is_category());
    $wp_query->is_category = false;
    echo(is_category());

    does output both times "1", when it should output "0" the second time.

    is this a bug? is there any workaround?

Topic Closed

This topic has been closed to new replies.

About this Topic