Sidebar Plugin For Thesis Statements

On By In 1

One of the things I learned from creating multiple custom page templates within the Thesis framework was how to create and modify sidebars. WordPress and Thesis provide you with a simple an effective way for implementing sidebars on your website with the use of simple syntax, options, and widgets. However beyond the basics you may have the need or desire to have different sidebar options for different types of pages.

Depending on how you’ve setup and defined your website, you may want specific items to appear in sidebars for different pages. You may want a sidebar that doesn’t contain anything the default sidebars display. The way Thesis and WordPress work “out of the box” limits your options because you only have 2 sidebars.

With this tutorial your sidebar options are limitless and the boundaries are defined by your needs.

Before I go much further if you are really new to using Thesis and customizing it you should read my little primer from my first Thesis tutorial before going further.

The Table of Contents If You Please

I will explain how to do the following:

  1. Define and implement your basic, baseline sidebar(s)
  2. Define and implement a custom sidebar for a specifc page or pages to show instead of the default sidebar(s)
  3. Define and implement a custom sidebar to show with any default sidebar

Between these three options you WILL be able to mix-and-match and create sidebar options that will work for your needs. If you plan ahead, think it through, code, test, code, test and test again you will get it to work.

Here we go.

Basic Sidebars

Once you have Thesis installed you will want to proceed to the Design Options it offers you. It is here that you will define the basic, or core, page layout that all pages and posts will inherit. Anything NOT customized inside of custom_functions.php or custom.css will take on the layout you define in this area.

Once you have logged into your admin area you will want to go to the left-hand sidebar to Appearance/Design Options. Once the page has loaded you should see Site Layout options in the second column as seen here:

  • You need to first select the type of layout that you would like to use—be it 1, 2, or 3 columns.
  • Once you have selected a 2 or 3 column option in the pull down menu, you immediately will be presented with options.
  • You will need to enter a width for your content column and specify a column order for your baseline design in the panel pictured here…

That’s all that is needed to activate and “install” your basic, default sidebars. This gives you a baseline to work from.

Next we will talk about custom sidebars.

Testing for Specific Pages and Inserting Sidebars

What if you want a custom sidebar, or you have a custom page template and want the standard sidebars? You may want specific content in a sidebar on a specific page, sets of pages, or specific categories in addition, or instead of the default sidebars.

If this is the case then here is the deal.

You will need to open up the file custom_functions.php file that resides here:


You are going to write a function that tests for the page or category, pulls in your content, and renders your sidebar how you like it.

You need to:

  1. name your function
  2. test to see if the page or category matches the criteria
  3. if so, then render the page/category content
  4. THEN render your custom sidebar(s)

You can see an example here where I test for a page with the name “press” which also has a page ID of “512”

/* CUSTOM SIDEBAR TEMPLATE */ function custom_sidebar_01() { if (is_page('press') || is_page('512')) { ?> <div id="content"> <div class="post_box"> <div class="headline_area"> <h2>Your Headline</h2> </div> ...This is where your content goes... </div> </div> <div id="sidebars"> <?php thesis_build_sidebars(); ?> </div> <?php } } remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample'); add_action('thesis_hook_custom_template', 'custom_sidebar_01');

There is a call in the code above:

<?php thesis_build_sidebars(); ?>

This php line above is what builds the default sidebars you setup in the first part of this tutorial.

Any Combination of Sidebars

What if you want…

  • one of the default sidebars to show with a custom sidebar?
  • a custom sidebar with no default sidebars?
  • define any number of custom sidebars for any number of custom pages or categories?

There are two key things you will need to accomplish any of the above:

  1. Define a custom sidebar in custom_functions.php
  2. A plugin that allows you to use widgets in more than one sidebar

Defining a custom sidebar in custom_functions.php

I will admit that I did not create the following masterful stroke of coding. The kudos for that goes to Kristarella. I was in the DIYThemes forums working on helping with some custom page templates and the question came up about adding additional sidebars. Kristarella jumped in and provided some help.

To create a third, fourth, fifth sidebar (you can create as many as you like using this coding) you need to first register the sidebar. Be sure you are working inside of custom_functions.php

/* CUSTOM SIDEBARS */ register_sidebars(1,     array(         'name' => 'Sidebar 3',         'before_widget' => '<li class="widget %2$s" id="%1$s">',         'after_widget' => '</li>',         'before_title' => '<h3>',         'after_title' => '</h3>'     ) );

You can repeat the above code replacing “Sidebar 3” with “Sidebar 4” etc.

Once you have defined the sidebar(s), the next step is to implement it in a page, category, or post. To create a custom function that tests for a specific page, category, or post I recommend checking out my previous tutorial Multiple Custom Page Templates.

You should plan out exactly what you are after before fussing with code.  For the sake of this tutorial I have coded my custom_functions.php file to display a custom sidebar 3 which contains a specific comment, a yellow background, and calendar. The new custom sidebar 4 which contains aspecific comment and twitter comments.

You can tell if I have done this correctly by looking at the sidebar on this test page. The sidebars will be different from every other page on this website. Coolness.

The full function to test and implement custom sidebars

I first defined the third sidebar as the code above suggests. Next I created a function that tests for this specific page inside of custom_functions.php.

In the function I created I call for the page content, and call for the custom sidebars I defined previously, sidebar 3, and a new custom sidebar 4. Then I make the call for the custom template to be implemented.

/* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */ function custom_sidebar_01() { if (is_page('sidebar-3')) { ?> <div id="content"> <div class="post_box"> <div class="headline_area"> <?php the_title('<h1>', '</h1>'); ?> </div> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="format_text"> <?php the_content( ); ?> </div> <?php endwhile; ?> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> </div> <div id="sidebars"> <div id="show-only-3-and-4"> <?php sidebar_3(); ?> <?php sidebar_4(); ?> </div> </div> <?php } } remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample'); add_action('thesis_hook_custom_template', 'custom_sidebar_01');

Once the sidebars are working you will need to setup styling to make the sidebars have the proper width and floats to get the sidebars to behave in your layouts. In my case this is the CSS I used to get the results on this page.

div#sidebar_3.sidebar, div#sidebar_4.sidebar { width: 217px; } div#sidebar_3.sidebar { float: left; background-color: yellow; } div#sidebar_4.sidebar { float: left; background-color: silver; }

A custom sidebar with a standard sidebar

In order to have one of the default sidebars show up with one of your custom sidebars you only need to change what sidebars you are calling. For example in the following snippet of code you can see how to do it by calling for the custom sidebar 3 and the default sidebar 1. To call the second sidebar you would change the number 1 to number 2.

<div id="sidebars"> <?php sidebar_3(); ?> <?php thesis_sidebar_1(); ?> </div>

What about that plugin?

There is a plugin I used in combination of creating the custom sidebars because in the current model of WordPress default behavior is that you can only use a widget once in all sidebars. So, I use a plugin called “Widgets Reloaded” that allows me to reuse a core set of widgets across all sidebars. Take a look and give it a go.

Wrap Up

From the outlined code above you may see how it is now possible to create as many custom templates as you like and get the look and function you are after. Hopefully this tutorial will get you started on the right track.

Hope this helps you.

Do you need help with your website?

If you are a web designer or web developer needing help, or a 'do-it-yourselfer' looking for a professional Internet presence I can help. If you need help with a specific WordPress issue or a complete website, I offer consultation, complete web design, and web development services. Get in touch and we can talk about your needs and start the process.


Manage and replace sidebars and other widget areas on your site with Custom Sidebars, a flexible widget area manager.

Make custom sidebar configurations and be able to choose what widgets display on each page or post of your site.

Display Different Sidebars on Pages and Posts

Custom Sidebars allows you to dynamically display custom widget configurations on any page, post, category, post type, or archive page.

Custom Sidebars allows you to display custom widget configurations on any page, post, category, post type, or archive page.

“Custom Sidebars will go on my “essential plugins” list from now on. I am pleased by how easy it was to figure out and by how many options are available in the free version.” – monkeyhateclean

“This plugin does exactly what it says. It’s light, integrates well into WordPress and gives you tons of possibilities.” – DarkNova

Every part of Custom Sidebars integrates seamlessly with the Widgets menu for simplicity and control. No confusing settings pages or added menu items, just simple core integration.

A Simple Flexible Sidebar Manager

Custom Sidebars Includes:

  • Unlimited custom widget configurations
  • Set custom widgets for individual posts and pages, categories, post types, and archives
  • Seamless integration with the WordPress Widgets menu
  • Works with well-coded themes and doesn’t slow down your site
  • Set individual widget visibility – for guests, by user role, by post type, for special pages or categories
  • Author specific sidebars – display a custom sidebar for each of your authors
  • Clone and sync widget settings – quickly edit complex configurations
  • Import and export custom sidebars – backup and share sidebars

Install Custom Sidebars and see for yourself why it’s the most popular widget extension plugin available for WordPress with over 200,000 active installs.

Custom Sidebars Is Fully-Loaded

If you run a design agency, or just want to get rid of the ads, checkout Custom Sidebars Pro:

Get Custom Sidebars for targeted marketing, better widgets for each level of your membership site, or just to clean up bloated content on each page. Download and try it for free!

Contact and Credits

Custom sidebars is maintained and developed by WPMU DEV.

Original development completed by Javier Marquez

Custom Sidebars uses the great jQuery plugin Tiny Scrollbar by Maarten Baijs.


There are two ways of installing the plugin:

From the WordPress plugins page

  1. Download the plugin, extract the zip file.
  2. Upload the folder to your directory.
  3. Active the plugin in the plugin menu panel in your administration area.

From inside your WordPress installation, in the plugin section.

  1. Search for custom sidebars plugin.
  2. Download it and then active it.

Once you have the plugin activated you will find all new features inside your “Widgets” screen! There you will be able to create and manage your own sidebars.

Find more usage information on the Custom Sidebars Pro page.

Preguntas frecuentes

Installation Instructions

There are two ways of installing the plugin:

From the WordPress plugins page

  1. Download the plugin, extract the zip file.
  2. Upload the folder to your directory.
  3. Active the plugin in the plugin menu panel in your administration area.

From inside your WordPress installation, in the plugin section.

  1. Search for custom sidebars plugin.
  2. Download it and then active it.

Once you have the plugin activated you will find all new features inside your “Widgets” screen! There you will be able to create and manage your own sidebars.

Find more usage information on the Custom Sidebars Pro page.

How do I begin working with this plugin?

Please refer to the usage section of Custom Sidebars Pro

Why can’t I see a widget menu?

This plugin requires your theme to have widget areas enabled, if you don’t have widget areas enabled you probably need to use a different theme that does!

Where do I set my sidebars up?

You have a sidebar box when editing a entry. Also you can define default sidebars for different posts and archives.

Why do I get a message ‘There are no replaceable sidebars selected’?

You can create all the sidebars you want, but you need some sidebars of your theme to be replaced by the ones that you have created. You have to select which sidebars from your theme are suitable to be replaced in the Custom Sidebars settings page and you will have them available to switch.

Everything is working properly on Admin area, but the custom sidebars are not displayed on the site. Why?

You are probably using a theme that doesn’t load dynamic sidebars properly or doesn’t use the wp_head() function in its header. The plugin replaces the sidebars inside that function, and many other plugins hook there, so it is more than recommended to use it.

It appears that only an Admin can choose to add a sidebar. How can Editors (or any other role) edit customs sidebars?

Any user that can switch themes, can create sidebars. Switch_themes is the capability needed to manage widgets, so if you can’t edit widgets you can’t create custom sidebars. There are some plugins to give capabilities to the roles, so you can make your author be able to create the sidebars. Try User role editor

Can I use the plugin in commercial projects?

Custom Sidebars has the same license as WordPress, so you can use it wherever you want for free. Yay!

I like the plugin, but what can I do if my website is based in a WP version older than 3.3

If you are running a earlier version of WordPress download Custom Sidebars 0.8.2.

Registro de cambios


  • Added integration with Polylang – now you can choose sidebar depend on Polylang language.
  • Added integration with WPML – now you can choose sidebar depend on WPML language.
  • Added check to avoid warnigs when user delete term which is assigned to “Sidebar Location”.
  • Updated “WPMU Dev code library” to version 3.0.5.


  • Improved assets directories.
  • Improved widgets on very small screens.
  • Fixed bulk edit problem with resetting sidebars.
  • Fixed few notices on import screen.


  • Added a quick and a bulk edit to custom post types.
  • Added nonce check for set location, import & export actions to avoid CSRF vulnerability.
  • Fixed a problem with getting sidebars settings for nested pages with more than 2 levels.
  • Fixed a problem with widget visibility on taxonomy archive page.
  • Fixed a typo on Import/Export screen.


  • Added ability to turn off “Custom Sidebars” for certain roles.
  • Fixed a problem with a category, category archive, and post in category replacement.
  • Fixed a problem with removed “Category Archive” from “For Archives” options.
  • Fixed build in taxonomies problem on “Sidebar Location” edit window.

  • Fixed CSRF vulnerability. Props for qasuar


  • Added bulk sidebars edit.
  • Fixed category archive and entry in category replaceable.
  • Visibility of “Custom Explain” link is limited only to front-end.

  • Fixed visibility of Custom Explain – now it is visible only for administrators.


  • Added ability to replace sidebars for category archive.
  • Added ability to replace sidebars for custom taxonomy archive.
  • Added ability to turn on Custom Sidebars Explain mode from Admin Bar.
  • Fixed a replacement problem on 404 pages.
  • Improved “Sidebar Location” popup – added a message when we do not have any replaceable sidebar.
  • Refactored “Column Sidebars” on post list screen.


  • Added width to “Custom Sidebars” column on entries list screen to avoid uncontrolled column width.
  • Added ability to add new sidebar using the only keyboard, after you fill name just push enter to move to the description field. Hit enter on description field to add a new sidebar.
  • Fixed “WPMUDEV Frash” message for pro version.


  • Improved columns display on post list screen – now “Custom Sidebars” column is hidden by default.
  • Prevent to load assets on front-end.
  • Updated “WPMU Dev code library” to version 3.0.4.
  • Fixed a CSS glitch on media library.
  • Fixed a JavaScript conflicting with CiviCRM plugin.
  • Fixed a problem with taxonomies.


  • Improved “Create a custom sidebar to get started.” box.
  • Upgraded “WPMU Dev code library” to version 3.0.3.
  • Fixed a problem with empty taxonomies, now we can see all taxonomies, including empty.
  • Fixed fetching posts.
  • Fixed a problem on the Customizer page – removed clone option.
  • Fixed Widgets Screen for Right to Left languages.


  • Removed WP Checkup banner.


  • Fixed compatibility issue with uBlock Origin and AdBlock Plus.
  • Fixed getting started box not appearing.

  • Added the “Create custom sidebar to get started.” box.
  • Fixed a problem with the link to disable accessibility mode.
  • Fixed UX problem with “plus” icon on visibility options.
  • Show advertising for “WP Checkup” in the whole admin area.

  • Fixed a problem with wp_enqueue_script which was called too early.
  • Fixed a problem with advertising, which should stay close when you close it.

  • Fixed a conflicting with other plugins.
  • Improved functionality, free and pro versions have now the same functionality. The only difference is that the free version includes ads.

  • Fixed a problem with empty selectors.
  • Remove unnecessary HTTP header – it is only needed when we run cs-explains.
  • Update Dash notice.

  • Fixed export problem, when two or more widget has the same name.
  • Fixed problem with import widgets created before Custom Sidebars plugin was installed.
  • Fixed problem with sidebars on Front Page.

  • Added support and widgets links on the plugins page.
  • Fixed export problem, when two or more widget has the same name.
  • Fixed few “Undefined index” warnings.
  • Improved import preview screen.
  • Improved RTL languages on widgets screen.

  • Rollback last change with front page.

  • Fixed a bug when we try to use to get property of non-object in “maybe_display_widget()”.
  • If front page is a page, then we have now the same rules like we have on on page.

  • Added new filter “cs_replace_post_type” to filter post type inside function “determine_replacement()”.

  • Fixed problem with sorting and filtering.

  • Added check if there the function “mb_strtolower”.

  • Sidebars are now sorted by name.

  • Fixed a problem with unclickable items on widgets admin screen.

  • Fixed undefined index in Sidebars Editor.

  • Fixed issue with broken link icon for cloned widgets.

  • Small improvements in the admin UI: Better scrolling, fix JavaScript errors and PHP notices.
  • Update third party libraries.
  • Small improvements in code.

  • Fix missing text-domain in translation

  • Fix incompatibility with PopUp plugin

  • Close possible security hole (XSS vulnerability)

  • Fix incompatibility with PopUp plugin

  • Fixed: Sidebars could not be created on certain webserver setups.

  • Fixed: Minified CSS files included now.

  • Better: Add context-guide how to changes settings for static front-page.

  • New: Assign a Sidebar to 404 pages via the Sidebar Location dialog.

  • Fix: In some browsers the “Add sidebar” popup was partially hidden.
  • Fix: Sometimes the dropdown list of a multiselect list stayed open.
  • Fix: Plugin now correctly loads the .po files to translate to other languages.
  • Some other small improvements.

  • Fix: For some users the plugin was not loading anymore after updating to

  • Fix: Z-index issue in Dashboard where wide widgets where covered by the main-menu.
  • Fix: Added compatibility for static front-page sidebars with version 2.0.9

  • Fix: Sidebar Locations “Front Page” and “Post Index” now work correctly.

  • Fix: Sidebars now support unicode-text in name/description.
  • Minor: New debugging output that explains why a sidebar/widget is displayed.


  • Fix: Fixed issue with WP sidebar chooser right after creating a new sidebar.
  • Fix: Fixed various issues when flagging a sidebar s replaceable.
  • Fix: Plugin will not load in accessibility mode but display a notice instead.
  • Minor fix: Make code compatible with PHP 5.2.4
  • Minor fix: Slight improvement of AJAX stability
  • Minor fix: Plugin now requires capability “edit_theme_options”


  • Fix: Fixed issue with settings not being saved correctly.


  • Fix: Fixed issue with some people losing some sidebar settings after update.

  • Minor fix: Use WordPress core functions to get URL to JavaScript files.
  • Minor fix: Refactor function name to avoid misunderstandings.


  • Fixed: Meta box in post editor did show missing sidebars (e.g. after switching the theme)
  • Fixed: PHP warning about strict standards.


  • Fixed: JavaScript errors on Windows servers are fixed.


  • Fixed: Dashboard notification is now removed when clicking “dismiss”


  • PHP 5.2 compatibility layer.


  • Complete UI redesign!
  • Many small bugfixes.


  • Added: WordPress filter “cs_sidebar_params” is called before a custom sidebar is registered.
  • Added: Add setting “CUSTOM_SIDEBAR_DISABLE_METABOXES” in wp-config.php to remove custom-sidebar meta boxes.


  • Added: Custom sidebars now works with BuddyPress pages.


  • Fixed: Individual post sidebar selection when default sidebars for single posts are defined
  • Fixed: Category sidebars sorting
  • Added: WP 3.8 new admin design (MP6) support


  • Fixed: Absolute paths that leaded to the outdated browser error
  • Fixed: Stripped slashes for the pre/post widget/title fields


  • Fixed: A lot of warnings with the PHP debug mode on
  • Improved: Styles to make them compatible with WP 3.6
  • Fixed: Creation of sidebars from the custom sidebars option
  • Fixed: Missing loading icons in the admin area
  • Removed: Donate banner. Thanks to the ones that have be supporting Custom Sidebar so far.


  • Fixed: Searches with no results shows default sidebar.
  • Added: RTL support (thanks to Dvir
  • Improved: Minor enhancements in the interface to adapt it to wp3.
  • Added: French and Hebrew translations
  • Fixed: Slashes are added to the attributes of before and after title/widget


  • Fixed: Where lightbox not showing for everybody (Thanks to Robert Utnehmer)
  • Added: Default sidebar for search results pages
  • Added: Default sidebar for date archives
  • Added: Default sidebar for Uncategorized posts


  • Fixed: Special characters make sidebars undeletable
  • Added: Child/parent pages support
  • Improved interface to handle hundreds of sidebars easily
  • Added: Ajax support for creating an editing sidebars from the widget page
  • Added: Italian translation


  • Fixed: Problems with Spanish translation
  • Added: Dutch and German language files
  • Fixed: Some CSS issues with WP3.3


  • Fixed: You can assign sidebars to your pages again.


  • Fixed: Category hierarchy is now handled properly by the custom sidebars plugin.
  • Added: Sidebars can be set for every custom post type post individually.
  • Improved the way it replace the sidebars.
  • Improved some text and messages in the back-end.


  • Fixed: Now the plugin works with themes like Thesis that don’t use the the_header hook. Changed the hook where execute the replacement code to wp_head.
  • Fixed: When a second sidebar is replaced with the originally first sidebar, it is replaced by the first sidebar replacement instead.


  • Fixed: Bulk and Quick editing posts and pages reset their custom sidebars.
  • Changed capability needed to switch_themes, and improved capability management.


  • New interface, more user friendly
  • Added the possibility of customize the main blog page sidebars
  • Added the sidebars by category, so now you can personalize all the post that belongs to a category easily in a hierarchical way
  • Added the possibility of customize the authors page sidebars
  • Added the possibility of customize the tags page sidebars
  • Added, now it is possible to edit the sidebars names, as well as the pre-widget, post-widget, pre-title, post-title for a sidebar.
  • Added the possibility of customize the sidebars of posts list by category or post-type.


  • Fixed a bug that didn’t allow to create new bars when every previous bars were deleted.
  • Fixed a bug introduced in v0.4 that did not allow to assign bars per post-types properly
  • Added an option to remove all the Custom Sidebars data from the database easily.


  • Empty sidebars will now be shown as empty, instead of displaying the theme’s default sidebar.


  • PHP 4 Compatible (Thanks to Kay Larmer)
  • Fixed a bug introduced in v0.2 that did not allow to save the replaceable bars options


  • Improved security by adding wp_nonces to the forms.
  • Added the pt-widget post type to the ignored post types.
  • Improved i18n files.
  • Fixed screenshots for documentation.



Leave a Reply

Your email address will not be published. Required fields are marked *