"Archives" and "Meta" widgets show up on "Search Results" pages (6 posts)

  1. mluther
    Posted 4 years ago #

    Using WP 3.4 and TwentyEleven Theme (version 1.4).

    In http://ourwebsite.com/wp-admin/widgets.php, we have removed the 4 widgets that were defaultly placed in "Main Sidebar".

    No widgets appear on regular pages.

    But when we try a search
    (for example, http://ourwebite.com/?s=foo&submit=Search)
    We see the "Archives" widget and the "Meta" widget.

    How come they are showing and how do we turn them off?

  2. JarretC
    Posted 4 years ago #

    You have 2 options.

    1. Stick an empty text widget in the Main Sidebar area and nothing will show.

    2. Create a child theme (http://codex.wordpress.org/Child_Themes) and then modify sidebar.php and remove the content between

    <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>


    <?php endif; // end sidebar widget area ?>

  3. mluther
    Posted 4 years ago #

    Thanks, JarretC.

    Is one option better than the other?

  4. JarretC
    Posted 4 years ago #

    #1 is much simpler if you don't want to go through the process of creating a child theme.

    Although it is highly advised that you create a child theme should you want to modify any code or CSS so that your customizations don't get overwritten with a theme update.

  5. mluther
    Posted 4 years ago #

    I have just created a child theme folder for my Twenty Eleven theme. I won't have a problem using a child theme, as long as I know exactly what to have in the child theme files.

    Thanks again, Jarret. I'll go with the recommended Option 2.

  6. mluther
    Posted 4 years ago #

    Jarret --

    Question 1: Will I ever have to undo the removal of code in the sidebar.php? If so, in what situations?

    Question 2: Are there any unwanted "side effects" of this code removal?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.