• Well, I am experimenting with the default theme and taking away some php lines here and there in order to see the effect .

    Whenever I take away <?php get_sidebar(); ?> I would expect the sidebar to disappear since the php file will not be included in the index.php … however this is not the case ..

    Why is this happening ?

    Grs – FOP

Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s cached in your browser?
    Hard refresh – Ctrl + F5

    Thread Starter fistofpeanuts

    (@fistofpeanuts)

    samboll… nope it’s not the refresh … I think that it’s the template hierarchy … it catches the sidebar.php file even if the statement in the index.php is missing ..

    That would mean that the only way to turn off the sidebar is to take away or rename the sidebar.php file …

    Am I correct here ?

    Grs – FOP

    Am I correct here ?

    No. The template hierarchy deals with ‘primary’ templates such as index.php, category.php and so on. Templates which are intended for inclusion in others, such as header.php and sidebar.php, are not handled in the same way.

    Removing <?php get_sidebar(); ?> will definitely remove the sidebar *code* in the default theme, but it will not change the layout (the space the sidebar takes up will still remain).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Why does the sidebar still appear if I take away <?php get_sidebar(); ?>’ is closed to new replies.