Title: remove &#039;view/hide&#039; from sidebar
Last modified: August 20, 2016

---

# remove 'view/hide' from sidebar

 *  Resolved [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/)
 * Do you have a filter to remove the ‘Click to view/hide’ function from the 2 column
   layout?
 * I’m using a plugin called Spots so I want the title to stay put.
 * [http://growersice.com/services/](http://growersice.com/services/)
 * Most appreciated.

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3550882)
 * There isn’t currently a filter for that, but I can easily add one (and good suggestion;
   thanks!).
 * Note that “show/hide” merely shows/hides the Widget _content_. The Widget _title_
   always shows.
 * If you want the default behavior of Widget content to be shown, instead of hidden,
   you can change that via `Dashboard -> Appearance -> Oenology Options -> General
   tab`.
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3550913)
 * I knew about the Option but this site just doesn’t require that function. If 
   this filter is not in the theme, how do I remove it?
 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3550995)
 * I just pushed these filters to the master development version:
    [https://github.com/chipbennett/oenology/issues/111](https://github.com/chipbennett/oenology/issues/111)
 * If you want to take advantage of it now, you can download the development version
   of `functions/widgets.php`, or simply [make the two small changes](https://github.com/chipbennett/oenology/commit/722fe0d065a4afd206af361fb07f8c0ac5753eab)
   yourself.
 * Then, you can write callbacks:
 *     ```
       add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
       add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       ```
   
 * (This shortcut brought to you by [the core `__return_false()` function](http://codex.wordpress.org/Function_Reference/_return_false).)
 * Note: be sure that `Dashboard -> Appearance -> Oenology Options -> General tab`
   Show/Hide widget content default is set to **show**.
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551003)
 * Can you clarify the steps for this?
    I made those changes to widgets.php then
   placed the callbacks in functions.php
 * Didn’t work.
    I must be missing something. Thanks
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551008)
 * Oh got it!
    I made the two small changes and placed the callbacks below. Thank
   you Chip!
 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551009)
 * > Oh got it!
   >  I made the two small changes and placed the callbacks below.
 * Yes, sorry; I should have clarified: the filters may need to be hooked in at `
   widgets_init`. If you want to put it in `functions.php`:
 *     ```
       function jknetdesign_filter_widget_stuff() {
           add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
           add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       }
       add_action( 'widgets_init', 'jknetdesign_filter_widget_stuff' );
       ```
   
 * …should do the trick.
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551010)
 * Yeah because i was wondering how to apply to child theme.
    So I reset the widgets.
   php file and placed that in functions and sorry but it didn’t work.
 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551059)
 * It works for me; but I made one additional change: I moved the functions `oenology_showhide_widget_content_open()`
   and `oenology_showhide_widget_content_close()` out of `functions/widgets.php`
   and into `functions/custom.php`.
 * Then, when I dropped the above `add_filter()` calls into `functions.php` to test,
   it worked for me.
 * Just to be sure, I tested in a Child Theme, and it worked for me as well.
 * I used the following, in both cases:
 *     ```
       add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
       add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       ```
   
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551082)
 * I’m not 100% on this. Should I:
    Leave this in functions.php?
 *     ```
       // Removes showhide function on sidebar
       function jknetdesign_filter_widget_stuff() {
           add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
           add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       }
       add_action( 'widgets_init', 'jknetdesign_filter_widget_stuff' );
       ```
   
 * Put widgets.php back to default?
 * Then what exactly do I edit in custom.php? on what line?
 * Are you saying that custom.php is left alone on theme update?
    Can I move functions/
   custom.php into my child theme folder?
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551088)
 * Any chance of taking a look at my previous comment?
    Can you give more exact 
   directions?
 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551094)
 * Sorry for delayed responses for a bit; I’m incredibly swamped at the moment.
 * I’m honestly unsure why it won’t work for you, but if you want to try what I 
   did:
 * 1. Move the `function oenology_showhide_widget_content_open(){}` and `function
   oenology_showhide_widget_content_close()`, and `function oenology_get_widget_args()`
   function definitions from `functions\widgets.php` into `functions\custom.php`
 * 2. Add the `apply_filter()` calls to `oenology_showhide_widget_content_open(){}`
   and `oenology_showhide_widget_content_close()`
 * 3. In your Child Theme `functions.php`, add the filter callbacks:
 *     ```
       add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
       add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       ```
   
 * (No need to put inside another callback.)
 * This worked for me, as tested in a test Child Theme.
 * Note: I’m getting close to having things ready for the next release, where your`
   add_filter()` calls should work out-of-the-box.
 *  Thread Starter [jknetdesign](https://wordpress.org/support/users/jknetdesign/)
 * (@jknetdesign)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551096)
 * It worked but what confuses me is the first step, when I cut the function from
   widgets.php, because what happens when an update replaces this file?
 * Here’s what I have:
    This function is not in widgets.php, it’s in custom.php 
   at the bottom — in the main theme.
 *     ```
       function oenology_showhide_widget_content_open() {
       	$options = oenology_get_options();
           $showhide = '<span class="showhide">';
           $showhide .= 'Click to ';
           $showhide .= '<span style="color:#5588aa;" onclick="d=this.parentElement.nextElementSibling; d.style.display==\'none\' ? d.style.display=\'block\' : d.style.display=\'none\';">view/hide</span>';
           $showhide .= '<br /></span>';
           $showhide .= '<div class="widget-inner" style="display:' . $options['widget_display_default_state'] . ';">';
   
           return apply_filters( 'oenology_showhide_widget_content_open', $showhide );
       }
   
       function oenology_showhide_widget_content_close() {
       	return apply_filters( 'oenology_showhide_widget_content_close', '</div>' );
       }
       ```
   
 * Then I have this in the functions.php — child theme
 *     ```
       add_filter( 'oenology_showhide_widget_content_open', '__return_false' );
       add_filter( 'oenology_showhide_widget_content_close', '__return_false' );
       ```
   
 * Is this correct?
 *  Theme Author [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551097)
 * > It worked but what confuses me is the first step, when I cut the function from
   > widgets.php, because what happens when an update replaces this file?
 * No worries. That’s the same change I made in the development version – meaning
   that, when the next version is released, that change will have been implemented.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘remove 'view/hide' from sidebar’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/oenology/3.5.2/screenshot.png)
 * Oenology
 * [Support Threads](https://wordpress.org/support/theme/oenology/)
 * [Active Topics](https://wordpress.org/support/theme/oenology/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/oenology/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/oenology/reviews/)

## Tags

 * [2 column layout](https://wordpress.org/support/topic-tag/2-column-layout/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)

 * 13 replies
 * 2 participants
 * Last reply from: [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/remove-viewhide-from-sidebar/#post-3551097)
 * Status: resolved