• lessthanweb

    (@lessthanweb)


    Hi,

    I’m doing a theme for my blog and can’t solve a problem.

    Here’s the layout:
    – home/index page which is index.php where is_home() is working just fine.

    – page template called with blog.php file. This page loads when i click on domain.com/blog (shows all posts). is_home() works the same way as on index page. Why? This is not the index page..

    There is just 1 sidebar that’s used by all files and inside it, i use is_home. Also tried is_front_page, is template page and nothing works..
    Page template acts as index.php..

    I haven’t set “front page” option in WP admin as index.php contains only stuff shown on index page.

    So the problem is that while i show some stuff on index page sidebar with the is_home, the same stuff is also shown on page template called blog sidebar. While all other normal pages, posts, search,… show the correct sidebar.

Viewing 1 replies (of 1 total)
  • Thread Starter lessthanweb

    (@lessthanweb)

    wp_reset_query(); <— adding this line to sidebar.php before conditional makes it work.

    wp_reset_query();
    if (is_home() == TRUE)
Viewing 1 replies (of 1 total)

The topic ‘Page Template, sidebar problems’ is closed to new replies.