If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

WordPress. How to manage hidden widgets

This tutorial will show you how to remove hidden widgets from sidebar in WordPress based on CherryFramework.

WordPress. How to manage hidden widgets

Hidden widgets are displayed in sidebar area of the posts pages when Sidebar widget area is empty.

Default hidden widgets are the following: Search , Navigation, Archives and Meta.

WordPress_How_to_manage_hidden_widgets

  1. Open your WordPress installation directory and navigate to wp-content\themes\CherryFramework folder.

  2. Copy sidebar.php from CheryFramework folder to \themeXXXXX folder (where XXXXX is your actual theme number). This will keep your changes if CherryFramework is updated.

  3. sidebar.php file contains the following code:

    <?php
      /**
      * Sidebar Name: Static Sidebar
      */
      ?>
    <?php if ( ! dynamic_sidebar( theme_locals("sidebar") )) : ?>
      <div id="sidebar-search" class="widget">
      <?php echo '<h3>' . theme_locals("search") . '</h3>'; ?>
      <?php get_search_form(); ?> <!-- outputs the default WordPress search form-->
      </div>
     <div id="sidebar-nav" class="widget menu">
      <?php echo '<h3>' . theme_locals("navigation") . '</h3>'; ?>
      <?php wp_nav_menu( array('menu' => 'Sidebar Menu' )); ?> <!-- editable within the WordPress backend -->
      </div>
     <div id="sidebar-archives" class="widget">
      <?php echo '<h3>' . theme_locals("archives") . '</h3>'; ?>
      <ul>
      <?php wp_get_archives( 'type=monthly' ); ?>
      </ul>
      </div>
     <div id="sidebar-meta" class="widget">
      <?php echo '<h3>' . theme_locals("meta") . '</h3>'; ?>
      <ul>
      <?php wp_register(); ?>
      <li><?php wp_loginout(); ?></li>
      <?php wp_meta(); ?>
      </ul>
      </div>
    <?php endif; ?>
    
    

    As you can see from the file, each widget has its own code in the file.

    1. Search widget:

      <div id="sidebar-search" class="widget">
        <?php echo '<h3>' . theme_locals("search") . '</h3>'; ?>
        <?php get_search_form(); ?> <!-- outputs the default WordPress search form-->
      </div>
      
    2. Navigation widget:

      <div id="sidebar-nav" class="widget menu">
        <?php echo '<h3>' . theme_locals("navigation") . '</h3>'; ?>
        <?php wp_nav_menu( array('menu' => 'Sidebar Menu' )); ?> <!-- editable within the WordPress backend -->
      </div>
      
    3. Archives widget:

      <div id="sidebar-archives" class="widget">
        <?php echo '<h3>' . theme_locals("archives") . '</h3>'; ?>
        <ul>
        <?php wp_get_archives( 'type=monthly' ); ?>
        </ul>
      </div>
      
    4. Meta widget:

      <div id="sidebar-meta" class="widget">
        <?php echo '<h3>' . theme_locals("meta") . '</h3>'; ?>
        <ul>
        <?php wp_register(); ?>
        <li><?php wp_loginout(); ?></li>
        <?php wp_meta(); ?>
        </ul>
      </div>
      
  4. Remove the code or comment it out to disable hidden widget in the sidebar.

Feel free to check the detailed video tutorial below:

WordPress. How to manage hidden widgets