Forums

is_archive() on home.php (3 posts)

  1. Operaatoors
    Member
    Posted 11 months ago #

    Hey!
    I have a problem.
    I wanted to make different sidebar on Archive pages, but I had a problem, and couldn't find solution.
    Function is_archive() returns True on my main page, and I'm using home.php template file for main page.

    I tried to compare HTTP headers with bloginfo('url'), but it also didn't worked. Maybe took wrong HTTP headers, but anyway - please help me.
    What would be the solution for this problem?

    PS. Talking about home.php template, Admin bar shows Edit Category, not Edit Page.

  2. alchymyth
    The Sweeper
    Posted 11 months ago #

    are you using a custom query in home.php?

    if so, try to close that properly, for instance with wp_reset_query()

  3. Chip Bennett
    Member
    Posted 11 months ago #

    I'm pretty sure that what you're observing is the expected behavior.

    The is_archive() conditional returns true when on an archive index. The Blog Posts Index is a form of archive index - it is simply returning all posts.

    What are you trying to accomplish with an is_archive() conditional in this context? There's probably another way, if we know what you're trying to do.

Reply

You must log in to post.

About this Topic