Home / template / Custom sidebar for home page
  • How to Custom sidebar for home page

    custom-sidebar-for-home-page

    Replacing the default get_sidebar() with this snippet to load a custom sidebar just for the home page. Be sure to name your new sidebar document sidebar-home.php.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?php
         if ( is_home() ) :
                  get_sidebar('home');
         else :
                  get_sidebar();
         endif;
    ?>
    

    ( WordPress codex functions, hooks, in this snippet. )

    home, get_sidebar, is_home,