Thesis Tutorial: Sidebars However You Like Them

thesis-binary

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:

picture-4

  • 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…

picture-5

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:

~/wp-content/themes/thesis/custom/

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.

, , , , , , ,

Do you need a WordPress consultant? Someone with experience?

I specialize in making WordPress work for people.

If you need help with a specific WordPress issue, I offer consultation, complete web design, and web development services.

Get in touch and we can talk about your needs and start the process.

  • http://www.expand2web.com/ Don Campbell

    Another great article.
    This one will come in handy for a project I’m working on – thanks Bert!

  • http://www.expand2web.com/ Don Campbell

    Another great article.
    This one will come in handy for a project I’m working on – thanks Bert!

  • Nicky

    Thanks for the tutorial. Somehow, I’m not able to get it work.

    I created the third sidebar, I can see it in admin menu of WordPress.

    I changed two things in the code you provided above –

    1) I used is_page(‘About’) since I want to try it out on About page.

    2) I removed the call since I’ve only created third sidebar.

    The default scheme is s1-content-s2 and I want to have content-s3 on About page.

    Any idea what went wrong ? Any help would be great :)

    • http://www.berchman.com berchman

      Hi Nicky,
      If I understand your comment #2 correctly you are not calling the sidebar?
      How are you calling sidebar 3?

  • Nicky

    Thanks for the tutorial. Somehow, I’m not able to get it work.

    I created the third sidebar, I can see it in admin menu of WordPress.

    I changed two things in the code you provided above –

    1) I used is_page(‘About’) since I want to try it out on About page.

    2) I removed the call since I’ve only created third sidebar.

    The default scheme is s1-content-s2 and I want to have content-s3 on About page.

    Any idea what went wrong ? Any help would be great :)

    • http://www.berchman.com berchman

      Hi Nicky,
      If I understand your comment #2 correctly you are not calling the sidebar?
      How are you calling sidebar 3?

  • Nicky

    Hmm, I left in your code above as it is. Isn’t it for calling sidebar 3?

  • Nicky

    Hmm, I left in your code above as it is. Isn’t it for calling sidebar 3?

  • Nicky

    Oops, missed the statement in above comment ->>

  • Nicky

    Oops, missed the statement in above comment ->>

  • Nicky

    Sorry for back to back comments. It seems wordpress isn’t displaying the statement. I’m using

    (without hyphens)

  • Nicky

    Sorry for back to back comments. It seems wordpress isn’t displaying the statement. I’m using

    (without hyphens)

  • http://www.mixedmetaphor.net/ Jenn

    What is the code to insert to get rid of the default sidebars entirely? In other words, there is a template for a page without sidebars, but if I want to create a custom page without sidebars, how do I tell Thesis not to insert the sidebars that has been set up as a default using the Options page? Thanks in advance.

  • http://www.mixedmetaphor.net Jenn

    What is the code to insert to get rid of the default sidebars entirely? In other words, there is a template for a page without sidebars, but if I want to create a custom page without sidebars, how do I tell Thesis not to insert the sidebars that has been set up as a default using the Options page? Thanks in advance.

  • http://www.berchman.com berchman

    Hi Jenn,
    You would follow the above code for the custom page template but do not call the sidebars at all. Depending on how you want the page width handed, etc. you would control that in you custom.css file. Hope this helps.

  • http://www.berchman.com berchman

    Hi Jenn,
    You would follow the above code for the custom page template but do not call the sidebars at all. Depending on how you want the page width handed, etc. you would control that in you custom.css file. Hope this helps.

  • http://recordingwiz.com/ Rick

    Hey man, thanks for the great info. Honestly though, all I’m looking to do is to hide the sidebars completely on a page, in order to create a type of landing page. Is there not some simple way to do this?

  • http://recordingwiz.com Rick

    Hey man, thanks for the great info. Honestly though, all I’m looking to do is to hide the sidebars completely on a page, in order to create a type of landing page. Is there not some simple way to do this?

  • http://damongudaitis.com/ Damon

    @Rick

    On the right side of the create/edit page page, there is a box that lets you select a template. By default there is a no-sidebars option.

  • http://damongudaitis.com/ Damon

    @Rick

    On the right side of the create/edit page page, there is a box that lets you select a template. By default there is a no-sidebars option.

  • http://recordingwiz.com/ Rick

    @Damon – Thanks so much! You’re the man. I knew there was some simple solution. You see, these are the types of options in Thesis that really make me love it. I can do some of the php hooks and stuff, but these little options save me sooooo much time. Now, I need to figure out how to hide the nav bar on this page too and I’ll be set to have a landing page within my blogsite as well.

  • http://recordingwiz.com Rick

    @Damon – Thanks so much! You’re the man. I knew there was some simple solution. You see, these are the types of options in Thesis that really make me love it. I can do some of the php hooks and stuff, but these little options save me sooooo much time. Now, I need to figure out how to hide the nav bar on this page too and I’ll be set to have a landing page within my blogsite as well.

  • http://www.serradinho.com/ George Serradinho

    Wow and thanks for the tips and tricks. I like the way you explained all the details in full. I think I will be using this in my next project which will be starting later this year, you have given me an idea.

    With WP 2.8, when released, will allow you to use many instances of widgets. That is what I understood.

  • http://www.serradinho.com George Serradinho

    Wow and thanks for the tips and tricks. I like the way you explained all the details in full. I think I will be using this in my next project which will be starting later this year, you have given me an idea.

    With WP 2.8, when released, will allow you to use many instances of widgets. That is what I understood.

  • http://www.rumblepup.com/ rumblepup

    This is what I’ve been looking for. It’s much easier and a more elegant solution to use included widgets and additional sidebars than hand jamming each and every custom page. Thank you señor!

  • http://www.rumblepup.com rumblepup

    This is what I’ve been looking for. It’s much easier and a more elegant solution to use included widgets and additional sidebars than hand jamming each and every custom page. Thank you señor!

  • http://societymatters.org Alan Mairson

    Thanks for a great post, but I have a rather simple sidebar question: I now have one sidebar, but need two. I want Sidebar #1 (my existing) to appear on the right side – and Sidebar #2 (the new one) to appear on the left. The built-in Thesis options don’t let me do this. Can you tell me how I can?
    Thanks in advance for whatever help you can provide….

    • http://www.berchman.com berchman

      Hi Alan,
      There are 2 ways to go about this. Simplest would be to copy down whatever widgets/customization you have in sidebar #1 and mirror that in sidebar #2. Then create a new sidebar #1 with whatever widgets you would like. Then in Thesis layout you could order your layout:

      [sidebar-1 (new sidebar)] [ content-area ] [sidebar-2 (current sidebar)]

      This should be the simplest way to do what you want. However….

      If you want multiple layout options I would follow the directions in my other tutorial regarding multiple custom page templates. You are going to want to create a layout where you place your current sidebar to appear on the right and the new one on the left. You hand code it so you have have the order come out however you like.

      Let me know if you have any questions.
      Hope this helps.

  • Alan M

    Thanks for a great post, but I have a rather simple sidebar question: I now have one sidebar, but need two. I want Sidebar #1 (my existing) to appear on the right side – and Sidebar #2 (the new one) to appear on the left. The built-in Thesis options don’t let me do this. Can you tell me how I can?
    Thanks in advance for whatever help you can provide….

    • http://www.berchman.com berchman

      Hi Alan,
      There are 2 ways to go about this. Simplest would be to copy down whatever widgets/customization you have in sidebar #1 and mirror that in sidebar #2. Then create a new sidebar #1 with whatever widgets you would like. Then in Thesis layout you could order your layout:

      [sidebar-1 (new sidebar)] [ content-area ] [sidebar-2 (current sidebar)]

      This should be the simplest way to do what you want. However….

      If you want multiple layout options I would follow the directions in my other tutorial regarding multiple custom page templates. You are going to want to create a layout where you place your current sidebar to appear on the right and the new one on the left. You hand code it so you have have the order come out however you like.

      Let me know if you have any questions.
      Hope this helps.

  • http://societymatters.org Alan Mairson

    I went ahead and did it the easy way — just copying the widgets. Thanks for replying & for a great site.

  • Alan M

    I went ahead and did it the easy way — just copying the widgets. Thanks for replying & for a great site.

  • http://www.antonamoto.com/ Anton

    Hi Berchman,

    I am new to Thesis Theme. I’ve just used it one week ago. One problem that bothers me is that my sidebar widgets did not display on Internet Explorer browser.

    I don’t know yet what has been caused. Please let me know if you can find sometimes to check it.

    Your reply is highly appreciated.

    • http://www.berchman.com berchman

      Hi Anton,
      When I just visited your website I see the sidebars. However I am using Google Chrome. :-)
      Have you fixed it?

  • http://www.antonamoto.com Anton

    Hi Berchman,

    I am new to Thesis Theme. I’ve just used it one week ago. One problem that bothers me is that my sidebar widgets did not display on Internet Explorer browser.

    I don’t know yet what has been caused. Please let me know if you can find sometimes to check it.

    Your reply is highly appreciated.

    • http://www.berchman.com berchman

      Hi Anton,
      When I just visited your website I see the sidebars. However I am using Google Chrome. :-)
      Have you fixed it?

  • Nick

    Hi Berchman,

    Is there a way to remove a sidebar from a post? I’m using a 2 sidebar setup, and would like to be able to remove one or both from posts in certain categories.

    Thanks!

    • http://www.berchman.com berchman

      I would follow my other tutorial to create a custom page template. In that tutorial you can see how you could create a page layout that does not include any sidebars.
      Let me know if you have any questions.
      Hope this helps.

  • Nick

    Hi Berchman,

    Is there a way to remove a sidebar from a post? I’m using a 2 sidebar setup, and would like to be able to remove one or both from posts in certain categories.

    Thanks!

    • http://www.berchman.com berchman

      I would follow my other tutorial to create a custom page template. In that tutorial you can see how you could create a page layout that does not include any sidebars.
      Let me know if you have any questions.
      Hope this helps.

  • Nick

    Thanks, I’ve been getting good use out of that tutorial. Making a custom template for a post is what’s hanging me up.

  • Nick

    Thanks, I’ve been getting good use out of that tutorial. Making a custom template for a post is what’s hanging me up.

  • http://paulbryan.wordpress.com/ Paul B

    ok, so using to show an example didn't work :)

    What I was trying to point out is that if you only put the php sidebar into a div with ID sidebars, Thesis will not style it as a normal side bar.

    If it is embedded the same way as a built-in sidebar, the built-in CSS will catch hold of it.

    It would need to be embedded in several layers for this to happen:
    <div id "sidebars"
    <div class "sidebar"
    <ul "sidebar_list"
    <php sidebar_whatever();
    </ ul
    </ div
    </ div

  • http://paulbryan.wordpress.com/ Paul B

    ok, so using to show an example didn't work :)

    What I was trying to point out is that if you only put the php sidebar into a div with ID sidebars, Thesis will not style it as a normal side bar.

    If it is embedded the same way as a built-in sidebar, the built-in CSS will catch hold of it.

    It would need to be embedded in several layers for this to happen:
    <div id "sidebars"
    <div class "sidebar"
    <ul "sidebar_list"
    <php sidebar_whatever();
    </ ul
    </ div
    </ div

  • http://www.7thpixel.com/ Gregory Banse

    Smashing tutorial – thank you!

  • http://www.7thpixel.com Gregory Banse

    Smashing tutorial – thank you!

  • http://www.mamanmedoc.com/ Kaz Clark

    I have successfully registered sidebars and they are showing up in my Appearance. I’ve got lost in the “call” code above though. If I want to call sidebar 1 (standard) and sidebar 3 (custom) on particular page how do I do that? I don’t have custom page templates as just use wordpress pages; so trying to simplify it and have got here …… I think my referencing re custom template etc wrong as jst wanting to change sidebars i.e. on a particular page to call two particular sidebars. The other bits of code above have not sunk in as to why I personally would need them “Not Found” etc; maybe I am missing huge point but I don’t have custom pages, just would like to customise my sidebars! Feel close, but not on the nose! Thanks!

    function custom_sidebar_01() {
    if (is_page(‘places’)) { ?>

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_01');

  • http://www.mamanmedoc.com Kaz Clark

    I have successfully registered sidebars and they are showing up in my Appearance. I’ve got lost in the “call” code above though. If I want to call sidebar 1 (standard) and sidebar 3 (custom) on particular page how do I do that? I don’t have custom page templates as just use wordpress pages; so trying to simplify it and have got here …… I think my referencing re custom template etc wrong as jst wanting to change sidebars i.e. on a particular page to call two particular sidebars. The other bits of code above have not sunk in as to why I personally would need them “Not Found” etc; maybe I am missing huge point but I don’t have custom pages, just would like to customise my sidebars! Feel close, but not on the nose! Thanks!

    function custom_sidebar_01() {
    if (is_page(‘places’)) { ?>

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_01');

  • http://www.copyblogger.com/proofreading-tips/ Shane Arthur

    Very nice.

    That three column example page you created is exactly what I need. I need a homepage that has three columns with no “bloglike” functionality. In other words, I want the three columns to act like a static website would if just coded with html and css. I need to continuously update the three columns with javascript code. Is this possible with your example and if so, how would I add the javascript to each column on a continual basis.

    thank you for your time.
    Shane

  • http://www.copyblogger.com/proofreading-tips/ Shane Arthur

    Very nice.

    That three column example page you created is exactly what I need. I need a homepage that has three columns with no “bloglike” functionality. In other words, I want the three columns to act like a static website would if just coded with html and css. I need to continuously update the three columns with javascript code. Is this possible with your example and if so, how would I add the javascript to each column on a continual basis.

    thank you for your time.
    Shane

  • kazclark

    Hi – I wonder if any of you kindly sidebar gurus may have an idea re an issue I am having. I managed to get the template working (a huge win for me!) but my widgets are loading up oddly. First my sidebars stacked on one side but then I css’s them float left, float right; and they went in my format sb/content/sb. But widgets loading middle down on my sb3 and top up on my sb4! I do wonder if I did my template wrong for the sb/content/sb format; or if the css call not supposed to be used for separating the sbs like I have. Have popped this on a slow burn but am really out of ideas as not knowing what I don’t know! Thanks very much.

    • http://www.berchman.com berchman

      Hi Kaz,
      Do you have a URL where I can look at your example? You can email me if you like.
      Hope this helps.

  • kazclark

    Hi – I wonder if any of you kindly sidebar gurus may have an idea re an issue I am having. I managed to get the template working (a huge win for me!) but my widgets are loading up oddly. First my sidebars stacked on one side but then I css’s them float left, float right; and they went in my format sb/content/sb. But widgets loading middle down on my sb3 and top up on my sb4! I do wonder if I did my template wrong for the sb/content/sb format; or if the css call not supposed to be used for separating the sbs like I have. Have popped this on a slow burn but am really out of ideas as not knowing what I don’t know! Thanks very much.

    • http://www.berchman.com berchman

      Hi Kaz,
      Do you have a URL where I can look at your example? You can email me if you like.
      Hope this helps.

  • http://thephotographerblog.com/ Mandy

    I was wondering how I can reduce the space between my widgets in the sidebar. I don’t know much about css but I think it’s got something to do with padding? Any help appreciated…

    • http://www.berchman.com berchman

      Mandy, you will want to edit the css that governs widgets. Widgets are put into an unordered list in the sidebar. Each widget is in a line item and you will want to adjust the margin and padding on that element.

  • http://thephotographerblog.com Mandy

    I was wondering how I can reduce the space between my widgets in the sidebar. I don’t know much about css but I think it’s got something to do with padding? Any help appreciated…

    • http://www.berchman.com berchman

      Mandy, you will want to edit the css that governs widgets. Widgets are put into an unordered list in the sidebar. Each widget is in a line item and you will want to adjust the margin and padding on that element.

  • http://www.myhalalkitchen.com/ Yvonne, My Halal Kitchen

    Hello,

    any suggestions about how to fix this nasty problem: myhalalkitchen.com

    If you scroll down, you’ll see all my sidebar widgets (2 columns worth) where they don’t belong. Can you offer any suggestions on how to fix this?

    thanks!

    • http://www.berchman.com berchman

      Yvonne, Looks like you got it sorted out. I was going to suggest looking at the width of your content area in the css.

  • http://www.myhalalkitchen.com Yvonne, My Halal Kitchen

    Hello,

    any suggestions about how to fix this nasty problem: myhalalkitchen.com

    If you scroll down, you’ll see all my sidebar widgets (2 columns worth) where they don’t belong. Can you offer any suggestions on how to fix this?

    thanks!

    • http://www.berchman.com berchman

      Yvonne, Looks like you got it sorted out. I was going to suggest looking at the width of your content area in the css.

  • Pingback: Berchman.com – Thesis tutorials

  • http://www.mamanmedoc.com/ Kaz Clark

    Hi – thought following email it may be helpful to show you where am with code; and leave a page up for you to see. My standard format is sb, content, sb and in this example I tested calling sb 3&4 to the custom template Chateaux; so close and yet feel so far!

    In custom functions:

    function custom_sidebar_01() {
    if (is_page(‘chateaux’)) { ?>

    <?php the_title('’, ”); ?>

    Not Found
    Sorry, but you are looking for something that isn’t here.

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_01');

    In custom css:

    div#sidebar_3.sidebar, div#sidebar_4.sidebar {
    width: 195px;
    }

    div#sidebar_3.sidebar {
    float: left;
    }

    div#sidebar_4.sidebar {
    float: right;
    }

    Have a feeling the custom css wrong but can't seem to get it to play – don't know right references for sb order i.e content, sb, sb or sb, sb, content or, as in my case sb, content, sb.

    You can see the funky results here:

    http://www.mamanmedoc.com/chateaux/

    Would be so great to crack this as been at this on and off for 2 months and not nailing it!

    Thanks

  • http://www.mamanmedoc.com Kaz Clark

    Hi – thought following email it may be helpful to show you where am with code; and leave a page up for you to see. My standard format is sb, content, sb and in this example I tested calling sb 3&4 to the custom template Chateaux; so close and yet feel so far!

    In custom functions:

    function custom_sidebar_01() {
    if (is_page(‘chateaux’)) { ?>

    <?php the_title('’, ”); ?>

    Not Found
    Sorry, but you are looking for something that isn’t here.

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_01');

    In custom css:

    div#sidebar_3.sidebar, div#sidebar_4.sidebar {
    width: 195px;
    }

    div#sidebar_3.sidebar {
    float: left;
    }

    div#sidebar_4.sidebar {
    float: right;
    }

    Have a feeling the custom css wrong but can't seem to get it to play – don't know right references for sb order i.e content, sb, sb or sb, sb, content or, as in my case sb, content, sb.

    You can see the funky results here:

    http://www.mamanmedoc.com/chateaux/

    Would be so great to crack this as been at this on and off for 2 months and not nailing it!

    Thanks

  • robyn

    Okay, so if I read correctly…

    I have 2 SB on my front page. I want 1 on all other pages. In order to accomplish this, I must create a page template without sidebars and then add on in using custom_functions.php. Correct?

    • http://www.berchman.com berchman

      Hi Robyn,
      Yes that is the way to go.

  • robyn

    Okay, so if I read correctly…

    I have 2 SB on my front page. I want 1 on all other pages. In order to accomplish this, I must create a page template without sidebars and then add on in using custom_functions.php. Correct?

    • http://www.berchman.com berchman

      Hi Robyn,
      Yes that is the way to go.

  • robyn

    Thank you!

  • robyn

    Thank you!

  • escalatoraccident

    Hey Berchman,

    First off, thanks so much for the tutorial. I appreciate you taking the time to help.

    I’m running into some problems and I posted my question and all my code on the forum. I’d dig it if you could check it out.

    http://diythemes.com/forums/customization/9441-custom-sidebars-still-need-help-after-berchmans-tutorial.html

    Thanks in advance for any help.

  • escalatoraccident

    Hey Berchman,

    First off, thanks so much for the tutorial. I appreciate you taking the time to help.

    I’m running into some problems and I posted my question and all my code on the forum. I’d dig it if you could check it out.

    http://diythemes.com/forums/customization/9441-custom-sidebars-still-need-help-after-berchmans-tutorial.html

    Thanks in advance for any help.

  • Pingback: Thesis Tutorial: Sidebars However You Like Them — berchman.com

  • Pingback: Thesis Tutorial: Sidebars However You Like Them — berchman.com

  • ilya

    Hi,

    I followed this tutorial to the T, but when php reaches the line: <?php sidebar_3(); ?>

    it quits.

    I can see thesis or wordpress re-catches itself becuase I don't get a blank page, but, there is no trace of my extra sidebar…

    where is the function sidebar_3() defined? Is registering it sufficient? I have the feeling the function sidebar_3 should also be defined no? Am I missing something?

    thesis 1.5.1 wordpress 2.8.3

  • ilya

    Hi,

    I followed this tutorial to the T, but when php reaches the line: <?php sidebar_3(); ?>

    it quits.

    I can see thesis or wordpress re-catches itself becuase I don't get a blank page, but, there is no trace of my extra sidebar…

    where is the function sidebar_3() defined? Is registering it sufficient? I have the feeling the function sidebar_3 should also be defined no? Am I missing something?

    thesis 1.5.1 wordpress 2.8.3

  • ilya

    Hi,

    I followed this tutorial to the T, but when php reaches the line: <?php sidebar_3(); ?>

    it quits.

    I can see thesis or wordpress re-catches itself becuase I don't get a blank page, but, there is no trace of my extra sidebar…

    where is the function sidebar_3() defined? Is registering it sufficient? I have the feeling the function sidebar_3 should also be defined no? Am I missing something?

    thesis 1.5.1 wordpress 2.8.3

  • berchman

    Hi ilya,
    the php code you tried to post did not show.
    If you put spaces between the ? and php it should post fine. Try that
    then I can take a look.

  • berchman

    Hi ilya,
    the php code you tried to post did not show.
    If you put spaces between the ? and php it should post fine. Try that
    then I can take a look.

  • berchman

    hi ilya,
    If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):

    / * 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 >'
    )
    );

    Once you have that defined and have setup your function as I assume you have done you need to make sure that the page you are wanting the custom sidebar on has the “custom template” option selected in the edit page for that specific page. Otherwise Thesis will not know that you want to run a custom template on that page and swap out the sidebars.
    Let me know if you have any questions.
    Hope this helps.

  • http://www.berchman.com berchman

    hi ilya,
    If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):

    / * 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 >'
    )
    );

    Once you have that defined and have setup your function as I assume you have done you need to make sure that the page you are wanting the custom sidebar on has the “custom template” option selected in the edit page for that specific page. Otherwise Thesis will not know that you want to run a custom template on that page and swap out the sidebars.
    Let me know if you have any questions.
    Hope this helps.

  • http://www.berchman.com berchman

    hi ilya,
    If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):

    / * 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 >'
    )
    );

    Once you have that defined and have setup your function as I assume you have done you need to make sure that the page you are wanting the custom sidebar on has the “custom template” option selected in the edit page for that specific page. Otherwise Thesis will not know that you want to run a custom template on that page and swap out the sidebars.
    Let me know if you have any questions.
    Hope this helps.

  • ilya

    Hi Berchman,

    Thanks for the quick reply. I really apreciate it.

    It seems I was not really on track: was testing with a custom sidebar that contains a subnavigation element. I was checking it on a page that did not have subpages… Doh.

    I get my example to work with the call
    dynamic_sidebar('Sidebar 3');
    or
    dynamic_sidebar(3);

    but not with:

    sidebar_3();
    This outputs something, but does not “load” the sidebar with the defined widgets..

    I have declared the third sidebar as you have done above.

    Could it be a dependance on a php version?

  • ilya

    Hi Berchman,

    Thanks for the quick reply. I really apreciate it.

    It seems I was not really on track: was testing with a custom sidebar that contains a subnavigation element. I was checking it on a page that did not have subpages… Doh.

    I get my example to work with the call
    dynamic_sidebar('Sidebar 3');
    or
    dynamic_sidebar(3);

    but not with:

    sidebar_3();
    This outputs something, but does not “load” the sidebar with the defined widgets..

    I have declared the third sidebar as you have done above.

    Could it be a dependance on a php version?

    • http://dbsw.net Distracted By Star Wars

      Thank you!!!

      I have been beating myself up for hours now trying to figure out why this tutorial wasn’t working. I’m not that great at PHP, but when the error was telling me that sidebar_3() hadn’t been defined I knew something was missing from this tutorial. Your little tip got it to work! Thank you again.

      @berchman: This tutorial is awesome, but it did take a little figuring out because of what I ilya and I went through. Thank for this anyway though, it’s making Thesis even better for me.

  • ilya

    Hi Berchman,

    Thanks for the quick reply. I really apreciate it.

    It seems I was not really on track: was testing with a custom sidebar that contains a subnavigation element. I was checking it on a page that did not have subpages… Doh.

    I get my example to work with the call
    dynamic_sidebar('Sidebar 3');
    or
    dynamic_sidebar(3);

    but not with:

    sidebar_3();
    This outputs something, but does not “load” the sidebar with the defined widgets..

    I have declared the third sidebar as you have done above.

    Could it be a dependance on a php version?

  • ilya

    All right, i succeeded what I wanted to do. And because this tutorial helped me achieve it I will share what I have done with you.

    I wanted a thesis two column layout, with the Sidebar on the right.
    On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.

    How did I achieve that? :

    I started out playing around with a three column layout. Jotting down the values from layout.css

    I then reverted the main layout to the two column layout, with the values that I needed.

    Then I created the custom template, as in this tutorial.

    Except I did not create a “third” sidebar, simply used as much of the thesis framework in place.

    So this is my custom page template function:

    function custom_page_with_navigation() {
    if (is_page()) {
    echo ' <div id=”column_wrap”>';
    thesis_content_column();
    thesis_get_sidebar(2);
    echo ' </div>';

    echo ' <div id=”sidebars”>';
    thesis_hook_before_sidebars();
    if (thesis_show_multimedia_box())
    thesis_multimedia_box();

    thesis_get_sidebar(1);

    thesis_hook_after_sidebars();
    echo ' </div>';
    } }

    I had to dig around a little in the thesis files. Basically I copied the functionality from
    thesis_wrap_columns() in lib/content_box.php
    thesis_sidebars in lib/sidebars.php
    thesis_build_sidebars in lib/sidebars.php

    Now all I had to do was to add the stylesheet information to get it to display properly:

    custom.css to the rescue

    first I had to mention there is a column_wrap div coming, with a certain width:
    .custom #column_wrap { width: 74.1em;}

    Then I had to mention that the content div needs to be smaller and float to the right. But only when it is inside a columnwrap, otherwise it would do it on every page…

    .custom #column_wrap #content { width: 55em; float: right; }

    Finally just mention that there is also a sidebar_2:

    .custom #sidebar_2 { width: 19em; border: 0; float: left; }

    And that is it..

    Of course this is not really usefull when you have all kinds of templates, but then one is probably better off with multiple template files, but then one has to duplicate more thesis framework functions. I would hope a future release has even more custom templating options…

    anyway, just thought I would share this. feel free to wrap this in a new tutorial if you feel this comment is too long :)

  • ilya

    All right, i succeeded what I wanted to do. And because this tutorial helped me achieve it I will share what I have done with you.

    I wanted a thesis two column layout, with the Sidebar on the right.
    On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.

    How did I achieve that? :

    I started out playing around with a three column layout. Jotting down the values from layout.css

    I then reverted the main layout to the two column layout, with the values that I needed.

    Then I created the custom template, as in this tutorial.

    Except I did not create a “third” sidebar, simply used as much of the thesis framework in place.

    So this is my custom page template function:

    function custom_page_with_navigation() {
    if (is_page()) {
    echo ' <div id=”column_wrap”>';
    thesis_content_column();
    thesis_get_sidebar(2);
    echo ' </div>';

    echo ' <div id=”sidebars”>';
    thesis_hook_before_sidebars();
    if (thesis_show_multimedia_box())
    thesis_multimedia_box();

    thesis_get_sidebar(1);

    thesis_hook_after_sidebars();
    echo ' </div>';
    } }

    I had to dig around a little in the thesis files. Basically I copied the functionality from
    thesis_wrap_columns() in lib/content_box.php
    thesis_sidebars in lib/sidebars.php
    thesis_build_sidebars in lib/sidebars.php

    Now all I had to do was to add the stylesheet information to get it to display properly:

    custom.css to the rescue

    first I had to mention there is a column_wrap div coming, with a certain width:
    .custom #column_wrap { width: 74.1em;}

    Then I had to mention that the content div needs to be smaller and float to the right. But only when it is inside a columnwrap, otherwise it would do it on every page…

    .custom #column_wrap #content { width: 55em; float: right; }

    Finally just mention that there is also a sidebar_2:

    .custom #sidebar_2 { width: 19em; border: 0; float: left; }

    And that is it..

    Of course this is not really usefull when you have all kinds of templates, but then one is probably better off with multiple template files, but then one has to duplicate more thesis framework functions. I would hope a future release has even more custom templating options…

    anyway, just thought I would share this. feel free to wrap this in a new tutorial if you feel this comment is too long :)

  • ilya

    All right, i succeeded what I wanted to do. And because this tutorial helped me achieve it I will share what I have done with you.

    I wanted a thesis two column layout, with the Sidebar on the right.
    On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.

    How did I achieve that? :

    I started out playing around with a three column layout. Jotting down the values from layout.css

    I then reverted the main layout to the two column layout, with the values that I needed.

    Then I created the custom template, as in this tutorial.

    Except I did not create a “third” sidebar, simply used as much of the thesis framework in place.

    So this is my custom page template function:

    function custom_page_with_navigation() {
    if (is_page()) {
    echo ' <div id=”column_wrap”>';
    thesis_content_column();
    thesis_get_sidebar(2);
    echo ' </div>';

    echo ' <div id=”sidebars”>';
    thesis_hook_before_sidebars();
    if (thesis_show_multimedia_box())
    thesis_multimedia_box();

    thesis_get_sidebar(1);

    thesis_hook_after_sidebars();
    echo ' </div>';
    } }

    I had to dig around a little in the thesis files. Basically I copied the functionality from
    thesis_wrap_columns() in lib/content_box.php
    thesis_sidebars in lib/sidebars.php
    thesis_build_sidebars in lib/sidebars.php

    Now all I had to do was to add the stylesheet information to get it to display properly:

    custom.css to the rescue

    first I had to mention there is a column_wrap div coming, with a certain width:
    .custom #column_wrap { width: 74.1em;}

    Then I had to mention that the content div needs to be smaller and float to the right. But only when it is inside a columnwrap, otherwise it would do it on every page…

    .custom #column_wrap #content { width: 55em; float: right; }

    Finally just mention that there is also a sidebar_2:

    .custom #sidebar_2 { width: 19em; border: 0; float: left; }

    And that is it..

    Of course this is not really usefull when you have all kinds of templates, but then one is probably better off with multiple template files, but then one has to duplicate more thesis framework functions. I would hope a future release has even more custom templating options…

    anyway, just thought I would share this. feel free to wrap this in a new tutorial if you feel this comment is too long :)

  • Pingback: Visual Slider, Unlimited Sidebars, Tabbed Widgets, and More! | 3asslema4Host

  • berchman

    Great to hear that you succeeded.

  • http://www.berchman.com berchman

    Great to hear that you succeeded.

  • http://www.berchman.com berchman

    Great to hear that you succeeded.

  • michaelmindes

    An extremely helpful instruction. It took me awhile, because I was getting hung up on a call error that basically said I was calling a function that didn't exist.

    What I needed to do was use:

    <?php dynamic_sidebar(sidebar_3); ?>

    Instead of:

    <?php sidebar_3(); ?>

    That fixed everything for me…

  • michaelmindes

    An extremely helpful instruction. It took me awhile, because I was getting hung up on a call error that basically said I was calling a function that didn't exist.

    What I needed to do was use:

    <?php dynamic_sidebar(sidebar_3); ?>

    Instead of:

    <?php sidebar_3(); ?>

    That fixed everything for me…

  • michaelmindes

    An extremely helpful instruction. It took me awhile, because I was getting hung up on a call error that basically said I was calling a function that didn't exist.

    What I needed to do was use:

    <?php dynamic_sidebar(sidebar_3); ?>

    Instead of:

    <?php sidebar_3(); ?>

    That fixed everything for me…

  • http://groundupmedia.com askjayson

    Hey Bercham, thanks so much for taking the time to write and share this tutorial with us. I am learning Thesis for a client and have a quick question. (I am still waiting for the login from the client to the Thesis support forums, otherwise I would post there as well).

    I simply want to display 3 column layout on the home page and keep the 2 column layout on all other pages. How can I call an addition default side bar? I can hide the sidebars with CSS, but dont want to write custom.css for all pages. Any quick simple ideas? Thanks so much in advance for your time.

    All the best,
    Jayson

    PS: I am a pretty savvy WP developer/designer, love to stay in touch.

  • http://jaysontcote.com askjayson

    Hey Bercham, thanks so much for taking the time to write and share this tutorial with us. I am learning Thesis for a client and have a quick question. (I am still waiting for the login from the client to the Thesis support forums, otherwise I would post there as well).

    I simply want to display 3 column layout on the home page and keep the 2 column layout on all other pages. How can I call an addition default side bar? I can hide the sidebars with CSS, but dont want to write custom.css for all pages. Any quick simple ideas? Thanks so much in advance for your time.

    All the best,
    Jayson

    PS: I am a pretty savvy WP developer/designer, love to stay in touch.

  • ilya

    I wanted to achieve something similar. I achieved as follows:
    - use thesis to calculate and render the 3 columns. Copy the CSS code.
    - use thesis to settle on the 2 column layout
    - use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.

    hope this helps…

  • ilya

    I wanted to achieve something similar. I achieved as follows:
    - use thesis to calculate and render the 3 columns. Copy the CSS code.
    - use thesis to settle on the 2 column layout
    - use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.

    hope this helps…

  • http://jaysontcote.com askjayson

    Hey Bercham, thanks so much for taking the time to write and share this tutorial with us. I am learning Thesis for a client and have a quick question. (I am still waiting for the login from the client to the Thesis support forums, otherwise I would post there as well).

    I simply want to display 3 column layout on the home page and keep the 2 column layout on all other pages. How can I call an addition default side bar? I can hide the sidebars with CSS, but dont want to write custom.css for all pages. Any quick simple ideas? Thanks so much in advance for your time.

    All the best,
    Jayson

    PS: I am a pretty savvy WP developer/designer, love to stay in touch.

  • ilya

    I wanted to achieve something similar. I achieved as follows:
    - use thesis to calculate and render the 3 columns. Copy the CSS code.
    - use thesis to settle on the 2 column layout
    - use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.

    hope this helps…

  • berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • http://www.berchman.com berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • http://www.berchman.com berchman

    Following up on Ilya I believe it depends on your layout.

    column, content, column
    or
    content, column, column, etc.

    This, I think will help you determine the best approach (i'm guessing
    that one line of css will do the trick depending on your layout).
    Let me know if you have any questions.

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    This tutorial seems great but i cant see sidebar 3 in my php code on my testscreen, so it doesnt show on that page?

    It's like:
    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>'
    )
    );

    doesn't work for me.

    This is the page where normal sidebar 3 must come
    The link is http://www.mikevsnet.be/?page_id=146

    Where did i go wrong?

    Thx

    Ps: do you also css for IE6(not for free ofcours)?

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    This tutorial seems great but i cant see sidebar 3 in my php code on my testscreen, so it doesnt show on that page?

    It's like:
    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>'
    )
    );

    doesn't work for me.

    This is the page where normal sidebar 3 must come
    The link is http://www.mikevsnet.be/?page_id=146

    Where did i go wrong?

    Thx

    Ps: do you also css for IE6(not for free ofcours)?

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    This tutorial seems great but i cant see sidebar 3 in my php code on my testscreen, so it doesnt show on that page?

    It's like:
    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>'
    )
    );

    doesn't work for me.

    This is the page where normal sidebar 3 must come
    The link is http://www.mikevsnet.be/?page_id=146

    Where did i go wrong?

    Thx

    Ps: do you also css for IE6(not for free ofcours)?

  • http://www.berchman.com berchman

    Hi Mike,
    I cannot see all the code you posted. Perhpaps it was stripped out in
    posting.
    Here is the code you need. I have put spaced in the tags so that the
    code stays in tact. Be sure to remove them:

    / * 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 >'
    )
    );

    Hope this helps.

  • http://www.berchman.com berchman

    Hi Mike,
    I cannot see all the code you posted. Perhpaps it was stripped out in
    posting.
    Here is the code you need. I have put spaced in the tags so that the
    code stays in tact. Be sure to remove them:

    / * 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 >'
    )
    );

    Hope this helps.

  • http://www.berchman.com berchman

    Hi Mike,
    I cannot see all the code you posted. Perhpaps it was stripped out in
    posting.
    Here is the code you need. I have put spaced in the tags so that the
    code stays in tact. Be sure to remove them:

    / * 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 >'
    )
    );

    Hope this helps.

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    I don't know what spaced in the tags mean?
    What part do i have to remove?

    sorry for my english

    thx

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    I don't know what spaced in the tags mean?
    What part do i have to remove?

    sorry for my english

    thx

  • http://www.berchman.com berchman

    Hi Mike,
    No problem.
    There are spaces between the < and the > of all the tags. This is so
    the website does not 'process' them and make them disappear.

  • http://www.berchman.com berchman

    Hi Mike,
    No problem.
    There are spaces between the < and the > of all the tags. This is so
    the website does not 'process' them and make them disappear.

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    I don't know what spaced in the tags mean?
    What part do i have to remove?

    sorry for my english

    thx

  • http://www.berchman.com berchman

    Hi Mike,
    No problem.
    There are spaces between the < and the > of all the tags. This is so
    the website does not 'process' them and make them disappear.

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    It still don't work for me:

    here is my code

    /* 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>'
    )
    );
    /* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */

    function custom_sidebar_01() {
    if (is_page('test')) { ?>
    <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>

    Sorry, but you are looking for something that isn't here.

    <?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');

    Maybe this helps to see my problem

    Thx mate

    Greetings from belgium

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    It still don't work for me:

    here is my code

    /* 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>'
    )
    );
    /* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */

    function custom_sidebar_01() {
    if (is_page('test')) { ?>
    <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>

    Sorry, but you are looking for something that isn't here.

    <?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');

    Maybe this helps to see my problem

    Thx mate

    Greetings from belgium

  • http://www.mikevsnet.be/ Mike

    Hi Berchman,

    It still don't work for me:

    here is my code

    /* 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>'
    )
    );
    /* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */

    function custom_sidebar_01() {
    if (is_page('test')) { ?>
    <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>

    Sorry, but you are looking for something that isn't here.

    <?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');

    Maybe this helps to see my problem

    Thx mate

    Greetings from belgium

  • jennybuttler

    Question….
    I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?

  • jennybuttler

    Question….
    I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?

  • jennybuttler

    Question….
    I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?

  • Pingback: Twitter Trackbacks for Thesis Tutorial: Sidebars However You Like Them — berchman.com [berchman.com] on Topsy.com

  • http://www.berchman.com berchman

    Indeed. You could build a function that tests for certain categories, and if the result is positive render the custom layout you would like. Sounds like I need to do another tut. :-) Let me know if you have questions.

  • http://www.berchman.com berchman

    Indeed. You could build a function that tests for certain categories, and if the result is positive render the custom layout you would like. Sounds like I need to do another tut. :-) Let me know if you have questions.

  • http://www.berchman.com berchman

    Indeed. You could build a function that tests for certain categories, and if the result is positive render the custom layout you would like. Sounds like I need to do another tut. :-) Let me know if you have questions.

  • http://thedanielrichard.com Daniel Richard

    I was looking at Copyblogger's site where he has the 2 sidebars shown throughout his blog, but on specific pages his sidebars were removed.

    Was that done using the same method as shown here?

  • http://thedanielrichard.com Daniel Richard

    I was looking at Copyblogger's site where he has the 2 sidebars shown throughout his blog, but on specific pages his sidebars were removed.

    Was that done using the same method as shown here?

  • http://thedanielrichard.com Daniel Richard

    I was looking at Copyblogger's site where he has the 2 sidebars shown throughout his blog, but on specific pages his sidebars were removed.

    Was that done using the same method as shown here?

  • http://hipfiles.com/ File Search Engine

    thanks … i am a newbie to thesis theme … this is helpful :)

  • http://hipfiles.com/ File Search Engine

    thanks … i am a newbie to thesis theme … this is helpful :)

  • http://hipfiles.com/ File Search Engine

    thanks … i am a newbie to thesis theme … this is helpful :)

  • http://www.berchman.com berchman

    You are welcome.

  • http://www.berchman.com berchman

    You are welcome.

  • http://www.berchman.com berchman

    You are welcome.

  • Susan

    I'm having the same problem as Mike, above. Using the code in the same way, in custom_functions.php. It's reading the custom template, but the page code stops at <div id=”show-only-3-and-4″> and I get a PHP fatal error: Call to undefined function sidebar_3() in /wp-content/themes/thesis_16b/custom/custom_functions.php on line 90. I've checked and rechecked my code against yours, looked at all the pages and tutorials you reference and just can't get it to work.

  • Susan

    I'm having the same problem as Mike, above. Using the code in the same way, in custom_functions.php. It's reading the custom template, but the page code stops at <div id=”show-only-3-and-4″> and I get a PHP fatal error: Call to undefined function sidebar_3() in /wp-content/themes/thesis_16b/custom/custom_functions.php on line 90. I've checked and rechecked my code against yours, looked at all the pages and tutorials you reference and just can't get it to work.

  • Susan

    I'm having the same problem as Mike, above. Using the code in the same way, in custom_functions.php. It's reading the custom template, but the page code stops at <div id=”show-only-3-and-4″> and I get a PHP fatal error: Call to undefined function sidebar_3() in /wp-content/themes/thesis_16b/custom/custom_functions.php on line 90. I've checked and rechecked my code against yours, looked at all the pages and tutorials you reference and just can't get it to work.

  • http://www.berchman.com berchman

    Hi Susan,
    I would check the names of each of your functions and calls to them.
    Typically there is something not matching properly when you see these
    errors.
    Hope this helps.

  • http://www.berchman.com berchman

    Hi Susan,
    I would check the names of each of your functions and calls to them.
    Typically there is something not matching properly when you see these
    errors.
    Hope this helps.

  • http://www.berchman.com berchman

    Hi Susan,
    I would check the names of each of your functions and calls to them.
    Typically there is something not matching properly when you see these
    errors.
    Hope this helps.

  • http://www.berchman.com berchman

    Hi Susan,
    I would check the names of each of your functions and calls to them.
    Typically there is something not matching properly when you see these
    errors.
    Hope this helps.

  • Pingback: 71 Best Tutorials for Thesis Wordpress Theme Users

  • andimac

    I'm getting the same php error. I think I'm missing something major here but can't figure it out.

    When you say you write a function to call the sidebars… what does that mean? Doesn't including that bit of code

    <div id=”sidebars”>
    <div id=”show-only-3-and-4″>
    <?php sidebar_3(); ?>
    <?php sidebar_4(); ?>
    </div>
    </div>

    in your custom template page do the trick? Do I have to define another custom function too? Sorry… confused. – Andi

  • andimac

    I have managed to get the function created like you have in your test page… and added the “register” code in custom_functions.php… but the widgets I add in the admin widgets manager don't show up. What have I done wrong? – Andi

  • http://www.andikuhn.com BigSea

    I'm having the same issue, Andi (and my name is also Andi -too funny). Everything is working but my sidebars are not showing.

    I know WordPress so well and Thesis is like learning a new language!

  • http://www.andikuhn.com BigSea

    I'm having the same issue, Andi (and my name is also Andi -too funny). Everything is working but my sidebars are not showing.

    I know WordPress so well and Thesis is like learning a new language!

  • sagar2121

    can u please tell me how do i change the advertise here boxes in the sidebar
    I made the changes but when i try do change it again it shows the previous boxes only here is my code

    CUSTOM VARIABLES
    //

    // defaults
    if (get_option(’tt_ad_one_img’)) {} else { add_option(’tt_ad_one_img’, ‘ad1.gif’); }
    if (get_option(’tt_ad_two_img’)) {} else { add_option(’tt_ad_two_img’, ‘ad2.gif’); }
    if (get_option(’tt_ad_three_img’)) {} else { add_option(’tt_ad_three_img’, ‘ad3.gif’); }
    if (get_option(’tt_ad_four_img’)) {} else { add_option(’tt_ad_four_img’, ‘ad4.gif’); }
    if (get_option(’tt_footer_opt’)) {} else { add_option(’tt_footer_opt’, ‘false’); }

    remove_action(’tt_ad_one_url’, ‘http://YOURID.maverick66.hop.clickbank.net/’);
    if (get_option(’tt_ad_one_url’)) {} else { add_option(’tt_ad_two_url’, ‘link for second image’); }

    if (get_option(’tt_ad_two_url’)) {} else { add_option(’tt_ad_two_url’, ‘link for second image’); }

    if (get_option(’tt_ad_three_url’)) {} else { add_option(’tt_ad_three_url’, ‘link for the third image’); }

    if (get_option(’tt_ad_four_url’)) {} else { add_option(’tt_ad_four_url’, ‘link for the fourt image’); }

    $tt_footer_removal = get_option(’tt_footer_opt’);

    $tt_twitter_username = get_option(’tt_twitter_name’);

    $tt_a1_img = get_option(’tt_ad_one_img’);
    $tt_a1_url = get_option(’tt_ad_one_url’);

    $tt_a2_img = get_option(’tt_ad_two_img’);
    $tt_a2_url = get_option(’tt_ad_two_url’);

    $tt_a3_img = get_option(’tt_ad_three_img’);
    $tt_a3_url = get_option(’tt_ad_three_url’);

    $tt_a4_img = get_option(’tt_ad_four_img’);
    $tt_a4_url = get_option(’tt_ad_four_url’);

    //
    // END OF CUSTOM VARIABLES
    //

  • paynemike

    Great post, Bert!

    Question for you: How can I have most of my website utilize a custom sidebar while the BLOG part of my website defaults to THESIS sidebar (i.e. multi-media box, widgets, etc)?

    My real estate site is http:www.sarasotahomesforsalenow.com

    I'd like the “MY BLOG” part of my site to be controlled by THESIS design options (if possible) or at least through custom_functions (if necessary).

    Thanks, Bert.

  • paynemike

    Great post, Bert!

    Question for you: How can I have most of my website utilize a custom sidebar while the BLOG part of my website defaults to THESIS sidebar (i.e. multi-media box, widgets, etc)?

    My real estate site is http://www.sarasotahomesforsalenow.com

    I'd like the “MY BLOG” part of my site to be controlled by THESIS design options (if possible) or at least through custom_functions (if necessary).

    Thanks, Bert.

  • http://www.berchman.com berchman

    Hi Mike,
    You need to build some custom sidebars then build a custom page
    template that uses those custom sidebars. You can see how to do the
    custom page tutorial on my site here:

    http://www.berchman.com/thesis-tutorial-multipl

    Hope this helps.

  • http://www.berchman.com berchman

    Hi Mike,
    You need to build some custom sidebars then build a custom page
    template that uses those custom sidebars. You can see how to do the
    custom page tutorial on my site here:

    http://www.berchman.com/thesis-tutorial-multipl

    Hope this helps.

  • http://www.bloggingthenews.info/ Damien Van Achter

    Hi,

    I really would like to give acces to my blog (http://www.bloggingthenews.info ) to other authors than myself. But I don't have time and money to switch it to a WordPress MU install.
    You show here that Thesis Theme allows to create multiple sidebars and assign sidebars to post/category/page .

    But, my point is to assign 2 custom sidebars/by Author (so if I have 20 authors on my blog, there will be 40 sidebars + the 2 general sidebars of the homepage)

    I'v installed the openhook plugin and, so far, it works pretty well

    Do you think it's possible ? Can you help me a bit (I'm a journalist, not a coder :-)

  • http://www.bloggingthenews.info/ Damien Van Achter

    Hi,

    I really would like to give acces to my blog (http://www.bloggingthenews.info ) to other authors than myself. But I don't have time and money to switch it to a WordPress MU install.
    You show here that Thesis Theme allows to create multiple sidebars and assign sidebars to post/category/page .

    But, my point is to assign 2 custom sidebars/by Author (so if I have 20 authors on my blog, there will be 40 sidebars + the 2 general sidebars of the homepage)

    I'v installed the openhook plugin and, so far, it works pretty well

    Do you think it's possible ? Can you help me a bit (I'm a journalist, not a coder :-)

  • http://www.berchman.com berchman

    Hi Damien, with the right code syntax I think it is possible. In terms of helping fill out my contact form on the site with as much detail as possible. Hope this helps.

  • http://www.berchman.com berchman

    Hi Damien, with the right code syntax I think it is possible. In terms of helping fill out my contact form on the site with as much detail as possible. Hope this helps.

  • MaryAnnEpstein

    Great tutorial but a little over my head. Or maybe I am just having a mental block about it.

    I need to make a page with two side bars totally different from the original side bars. I like choosing the no sidebar template, is there an easy place to get a template like that with page with sidebar 3 and 4.

    I know that once I do this the first time, I can use it in many ways.

    Help!!

  • MaryAnnEpstein

    Do you have a video tutorial for this? or Do you know of one? I think I need to be talked through it, not have to read it.

    :)

    Mary Ann

  • http://www.newyorkhardmoneyloans.com/ edwin

    I am currently reviewing wordpress, use at this moment xsitepro to develop my websites.

    Seems like wordpress or thesis is great also for developing static websites just have to get around the coding issues when looking to modify what thesis cannot do, just the same with xsitepro.

    What are your rates for consultation and simple tweaks, forward me your rates.

  • http://www.attractpheromone.com/ Gus

    I just starting with thesis but i like it more every sec! :)

  • http://www.attractpheromone.com/ Gus

    I just starting with thesis but i like it more every sec! :)

  • http://hackideas.com/ Sushant

    Hi, Thank you for the useful tutorials. I messed up a little.
    I need to disable sidebars from the home page only. Is there any custom hook we can use to disable sidebars.

  • normfields

    I'm trying to create a custom sidebar layout for specific post categories, rather than pages. For example, I want to display video posts with no sidebars to allow the videos to fill the entire width of page. I have found some code that claims to do it but it crashes the other pages.

  • DJMorrisFitness

    What if you want your site to have sidebars on all posts and the homepage, but not on any Pages?….Is that easy to set-up that way?

  • Claudia

    Hi

    I am using a one collum layout for my thesis theme and at the bottom I have sidebar 1 and sidebar 2, do you maybe know how I can make that into one big sidebar instead?

    Thank you so much

    Claudia
    The netherlands

  • http://www.antonamoto.com antonamoto

    I didn't notice your reply until I found your back links at Yahoo.com, well thanks for the tips and had fixed it.

  • http://www.berchman.com berchman

    You should refer back to the subtitle “The full function to test and implement custom sidebars” In that example you will see that I am using Sidebar 3 and Sidebar 4 in that page template. You could copy/paste that and have Sidebar 5/6/7/8, etc. You can make as many as your project needs.

  • http://www.berchman.com berchman

    I am now exploring the use of video on the tutorials. I know different people learn different ways so this is on my radar.

  • http://www.berchman.com berchman

    Edwin, Drop me a note using my form and I will be in touch: http://bit.ly/bujJJK

  • http://www.berchman.com berchman

    You can use the 'no sidebars' option in the custom menu dropdown.

  • http://www.berchman.com berchman

    You should be able to create a conditional that tests for a specific category then deliver the custom template you want. You may need to do this with the category ID.

  • http://www.berchman.com berchman

    Sure you could create a conditional that tests for “any page that is NOT the home page” then supply the needed custom template.

  • http://www.berchman.com berchman

    You could put all your 'widgets' into one sidebar, then make the change in Thesis design options to have a 2 column layout with one sidebar.

  • http://www.pharmacyebooks.com/ vijay

    Thank you for such a amazing piece of information. I am new to wordpress and thesis. I had gone through so many websites to customize my sidebars but I'm telling you non of those articles are not even close to you. Kudos my friend. Regards, VJ.

  • http://www.techcrank.com/ Shubham | Techcrank

    thanks for the custom sidebar..! great tutorial..! really helpful!

  • Wendy

    Hi,

    I am trying to widgetized the home page's middle content area. I have tried to replace the footer hook to a “before content hook” and screwed up my custom_functions.php file. Any suggestions would be helpful.

    Thanks,

  • Storm

    Really useful tutorials, thanks!!!

    I am new to Thesis and working on my 1st blog. What I'd like to do is use a background gradient image(sidebargradient.jpg) for the sidebar. Not sure what code I need to do this and there will need to be something to tell it to stretch the image, obviously, with sidebars being dynamic.

    I'm guessing I have to input code in both the custom.css and custom.functions.php files. Any help would be greatly appreciated, I'm working on a standard 2 column theme(right sidebar).

    Thanks

  • http://www.thesisthemedesign.net/ Thesis theme Design

    I think you people are first who have written an article on Side bar customization. It' s great buddy.

    Carry on with ur sweet blog.

  • http://brian.se/ Brian Einarsen

    I obviously screwed something up. Keeping sidebar 2 to the right and introducing sidebar 3 to the left.

    When using:

    I get this error message (the above is located on line 59):
    Fatal error: Call to undefined function sidebar_3() in /home/web81573/domains/brian.se/public_html/wp-content/themes/thesis_16/custom/custom_functions.php on line 59

    When using instead it looks like this:
    http://brian.se.linweb58.kontrollpanelen.se/om_brian/

  • http://brian.se/ Brian Einarsen

    I believe I made a comment but I am not sure it came through. I’ll try once again.

    I have a three column template and is satisfied with it and want to use the same template for my pages as well as for the blog post page. But what I do want for the pages is different content in the sidebars for each page.

    What I’ve done (using http://brian.se.linweb58.kontrollpanelen.se/om_brian/ as the page in focus – temporary url).

    1. Picked the Custom Template for the /om_brian/ page and published it.

    2. Inserted the following code (I chose to keep one of the default sidebars in this case) into custom_functions.php:
    /* Custom sidebars */

    register_sidebars(1,
    array(
    ‘name’ => ‘Sidebar 3′,
    ‘before_widget’ => ”,
    ‘after_widget’ => ”,
    ‘before_title’ => ”,
    ‘after_title’ => ”
    )
    );

    register_sidebars(1,
    array(
    ‘name’ => ‘Sidebar 4′,
    ‘before_widget’ => ”,
    ‘after_widget’ => ”,
    ‘before_title’ => ”,
    ‘after_title’ => ”
    )
    );

    /* Sidebars Om Brian */

    function custom_sidebar_01() {
    if (is_page(‘om_brian’) || is_page(‘2′)) { ?>

    <?php the_title('’, ”); ?>

    Not Found
    Sorry, but you are looking for something that isn’t here.

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_01');

    3. Used the same .css data as in your case (although I changed the width to 195), just to try it out.

    4. The result is a mess with only one sidebar spanning over two columns. Nothing from my newly created sidebar shows up.

  • Pingback: Add Custom Sidebars to Specific Pages Using the Thesis Theme

  • sonnyboytan

    hey, berchman. i seem to have problems combining your unlimited sidebars with kristarella's widgetized footer. when i register the sidebars, they register on the footer instead of beside the content area.
    i'm trying to make my homepage have 3 columns instead of 2 columns. so i opted for your custom page template design. now i have a problem customizing my custom page template. what do you think is the best option for me now? am i overcomplicating things?

  • Pingback: 47 Customizations for the Thesis Theme

  • http://www.berchman.com berchman

    Its in the sidebar(s) you are calling:

    <div id=”show-only-3-and-1″>
    <?php dynamic_sidebar(sidebar_3); ?>
    <?php thesis_sidebar_1(); ?>
    </div>

    You have registered the sidebars but have not built the right functions to call those newly registered sidebars. You need to add:

    /* ADDITIONAL SIDEBAR FUNCTIONS */

    /* sidebar 3 function */
    function sidebar_3() { ?>

    <div id=”sidebar_3″ class=”sidebar”>
    <ul class=”sidebar_list”>
    <?php thesis_default_widget(3); ?>
    </ul>
    </div>

    <?php }

    /* sidebar 4 function */
    function sidebar_4() { ?>

    <div id=”sidebar_4″ class=”sidebar”>
    <ul class=”sidebar_list”>
    <?php thesis_default_widget(4); ?>
    </ul>
    </div>

    <?php }

    Then in the code you have above where you have this:
    <div id=”show-only-3-and-1″>
    <?php dynamic_sidebar(sidebar_3); ?>
    <?php thesis_sidebar_1(); ?>
    </div>

    Use this instead:

    <div id=”show-only-3-and-4″>
    <?php sidebar_3(); ?>
    <?php sidebar_4(); ?>
    </div>

    That should do it.

  • http://www.berchman.com berchman

    You need to define a background image for div#sidebars
    Depending on the gradient you will want it to repeat vertically or horizontally so CSS accordingly.
    Hope this helps.

  • http://brian.se/ Brian Einarsen

    Thank you so much, I will check this out. Meanwhile I found the plugin Widget Logic which is making this type of solution possible in a similar but maybe to simple way.

  • http://www.berchman.com berchman

    There are a few widget plugins I know of that will allow you to specify what to show based on page, post, category, etc. They are very handy. AND when combined with something like this script makes the possibilities infinite.

  • http://www.berchman.com berchman

    You most likely have conflicting code. For example you need to check all the #'s that are being used:

    sidebar_3();
    custom_widget_02;

    etc.

    My bet is that the conflict is in the definition and calling of the sidebars. Hope this helps.

  • Brandon

    Hi thanks for this,

    I recently just got thesis and I'm using a 3 column layout. But I would like to add another sidebar that appears in every page just before the multimedia box. (and i want this new sidebar to take the combined width of the default 2 sidebars)

    Exactly how do I do that?

    thanks In advance!

  • ak

    Hi Berchman,

    This goes without saying that your article are very informative. I followed them and they work flawlessly. BUT… yeah as ususal there is always a BUT..

    I have created a static home page and then created a “BLOG” page > chose it as my blog page under wp > admin… now no matter any custom template page I create, it doesn't apply to this blog page.

    Apart from this there doesn't seem to be any function or hook to remove a sidebar in thesis… or maybe I am not away of this..

    Even “is_page()” doesnt work as it seems that this blog page is not considered as a page by wordpress, though it has an id. Only condition which works is — “if(!is_page()){ }

    All I am trying to do is create a separate sidebar(eg:sidebar 2) for my blog and let the sidebar 1 for rest of the site pages..

    Any suggestions?
    Thanks for your anticipated response :)
    ak

  • Pingback: Add Custom Sidebars

  • Christian

    Very helpful and was looking for this quite a while. But what if I want to keep the standard sidebar 1 on my custom page, but delete S2 and use the remaining full width?

  • Ken

    This is what I'm looking to do as well, Christian. It seems as though we need to create a full custom template, but just omit sidebar 2 and tailor the css as needed, but i'm stumped on how to do this.

  • Ken

    This is what I'm looking to do as well, Christian. It seems as though we need to create a full custom template, but just omit sidebar 2 and tailor the css as needed, but i'm stumped on how to do this.

  • http://www.berchman.com berchman

    Brandon, You need to create another sidebar, use a 'hook' to insert the sidebar before the MM-box, then use some crafty CSS to get it sized and displaying properly. Hope this helps.

  • http://www.berchman.com berchman

    Brandon, You need to create another sidebar, use a 'hook' to insert the sidebar before the MM-box, then use some crafty CSS to get it sized and displaying properly. Hope this helps.

  • http://www.berchman.com berchman

    Hi ak,

    You are partly on the right track.

    You need to use the is_page() function and test for your specific blog page.

    For example:

    is_page('blog')

    if the “slug” of your page is “blog”

    Also, be sure to have your “blog” page set to use a custom template from the dropdown menu in the page admin.

    Hope this helps.

  • http://www.berchman.com berchman

    Christian and Ken,
    I have a tutorial coming up soon that will show you how to achieve 4 different page layouts using a 3 column standard Thesis display and about a dozen lines of CSS code. Hope to post soon. I think it will either provide you with an answer or give you inspiration. Hope this helps.

    • Jess

      Thanks for the tut! I’m trying to accomplish the same thing at Christian and Ken, hiding my second sidebar on specific pages. I looked for the 4 layout/CSS tut you mentioned but didn’t see it, please let me know if I’ve missed it.  

    • Ken

       Berchman – did you ever do the tutorial you mentioned above?

  • LGV

    thanks a lot for this helpfull article !
    But i have a problem when i tried it. Maybe because i don't talk enough in english i don't know.
    i have this error message : Fatal error: Call to undefined function sidebar_4() in custom_functions.php on line 185…
    can you help me ?

  • http://www.careeroutlook.in Career outlook

    Great post, I have recently bought the thesis after hearing so many good reviews about it but after installing it, I found that it is very difficult to customise it. Thanks for this tutorial, it will going to be very helpful :)

  • Pingback: Visual Slider, Unlimited Sidebars, Tabbed Widgets, and More!

  • http://twitter.com/gamerforum Racing Green

    Ha… I am still really struggling with these sidebars. I wish Thesis would integrate single sidebar templates along with the standard ones… Maybe it will be coming in 2.0!

  • http://imkappel.com Sig Kappel

    I would like to completely remove the sidebar.. I thinking a hook but not sure how to do it quite yet.. any help is appreciated

    • http://howtowinyourexbacknow.net Kevin Ex

      If you want to remove the sidebar from a certain page or a post.. you can directly do it with WordPress. Right above the publish button, there is an option to select template. In that template, select no sidebars. Your post or page will be published without any sidebars.

      • http://www.atlantarealestateinfo.com/ Real Estate in Atlanta

        Exactly.

  • Pingback: Thesis Tutorial: Sidebars However You Like Them — berchman.com | Geek is a Lift-Style.

  • Pingback: The Huge Thesis Compilation| Skins , Resources , Tutorials

  • Emma

    Hi and thank you for this tutorial!

    I am able to get the code to work so that two custom sidebars are shown on a specified page, for example:

    function custom_template_sidebar_2() {
    if (is_page(64)) { ?>
    and so on…

    This works fine.
    But could you please, please tell me how to state the condition in order to show the custom sidebars if I have WP set to show blog posts instead of a static front page.

    I have tried

    if (is_home()) { ?>

    which doesn’t work but I understand that the condition needs to test for all pages that are not the “home” page.

    How would such code look?

    I have tried

    if (!is_home()) { ?>

    without any success.

    I am not a deadly programmer and really really need to figure this out.

    Cheers from Ireland.

  • http://www.funvblog.com funvblog

    Great article about sidebar customization. Defiantly it help me but also helps who want to use thesis in future. Currently I want to get thesis.

    Thanks for the article

  • http://www.netfunlog.com Rohit

    Thanks for the info, Its very helpful for me..!!

  • Aaron

    I’m just not getting it. I need to add 2 additional side bars to all pages. I get as far as them being added to the widget page, but they do not render on the site. Do I need to create a custom layout to make this work? How do I test for “all pages” if that is the case? I know barely any php so any help would be much appreciated.

  • http://profiles.google.com/leighmatthews Leigh Matthews

    I’m totally new to Thesis and have spent the weekend playing with it and getting frustrated! This tutorial looks like it’ll be of great help once I actually get my head around php… yup, I’m a newbie at that too.

    My question is: how do I get my sidebar(s) to simply move above my multimedia box? It seems odd that thesis doesn’t allow you to do this intuitively. I don’t (necessarily) want to create a new sidebar to put custom code in to act as a MM box as this is a bit beyond me right now.

    Perhaps I’m missing something really obvious but I just can’t seem to find a simple explanation of how to do this anywhere!

    Thanks
    Leigh

  • Ccmkramer

    I put this in my custom_functions.php.: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;
    }

    and got this error:

    Parse error: syntax error, unexpected T_STRING in /home/ccmkrame/public_html/wp-content/themes/thesis_18/custom/custom_functions.php
    on line 32

    My website is completely gone (only the above error shows), and I can’t get into my admin panel to take out what I put in either (again, only the above parse error shows).  Can someone help?

    • http://www.berchman.com berchman

      Hi ccmkramer,
      If you login via FTP you can open your custom_functions file and take out the offending php.

      The error is in your custom_functions.php file. Once you remove the offending code your site will come back online.
      Hope this helps.

  • http://www.digital-likers.com/ mask

    very good tutorial, everything is explained step by step

  • fatos

    Hi there….
    very well written article, can someone tell me how to go about doing this,
    I want both sidebars shown on home page but only sidebar 2 on a single post

                            home page
    sidebar 1 – content area – sidebar 2 

                           single post
        content area – sidebar 2

    Thank you

  • Nanette Turner

    Is there a way to remove the sidebars for a custom home page layout?  (I used your tutorial to create multiple custom pages, but would like to remove sidebars on certain custom pages.)

    • http://www.berchman.com Bert Mahoney

      Sure. You could just comment out the code, or simply not include it. Or you could select the “no sidebar” option when you specify the type of page template.

  • Ronallie

    finally I understand my problem plenty of thanks for this :)

  • Guest

    I would love to be able to give a different colour to each sidebar , content and footer. 

    • http://www.berchman.com Bert Mahoney

      You would need to set specific class values to different elements (divs, ids, etc.) then style it using CSS. Hope this helps.

  • Brian

    Great tutorial!

    I’m having trouble reducing the space between widget items.  Any thoughts?

    Thanks,
    Brian

    • http://www.berchman.com Bert Mahoney

      Most likely there is some element that is within the widget that is set to display as ‘block.’ For example and h2, h3, hx etc. would need to set CSS to display “inline-block” Hope this helps.

  • http://www.678passengervehicles.com Alex

    I’m still struggling with this.  I was thinking thesis was easier to change than it is.  I don’t like the “hooks” yet.

  • http://www.alspaulding.com AL Spaulding

    Found this article thru google and it will most definitely help me out with the redesign I’m doing over on my blog with my sidebars. Thanks a bunch. 
    ~Al

  • http://rt-now.com/ Rob T

    thanks for the tutorial

  • http://thebodyandsoullifeline.com Chris Glover

    why do I have a black bar at the top of my sidebar?
    http://thebodyandsoullifeline.com

    • http://www.berchman.com berchman

      Hi Chris,
      Could be your Multimedia box, pretty sure it is.
      You can turn that off in Thesis design preferences.
      Hope this helps.
      -Bert

    • http://www.berchman.com Bert Mahoney

      Most likely the setting for Multimedia box is set to display.

  • http://twitter.com/CBWebWorks CindyC Barnard

    Excellent posts. I have a question:

    how to indicate you want to target all of your blog posts with a particular sidebar and not your pages?If you can target by category do you still write…if (is_page(category-name))…Or, how do would you build a function to test for all, any, categories to render one custom sidebar for all blog posts?

    Thanks again for helpful tutorials.
    _Cindy

  • http://fajaar.com/ Fajar

    Terima kasih atas tutorialnya gan.keren banget :D

  • Clegeard

    Hi, thanks for this article, it helps me a lot.
    The only, I can’t get it work with category pages.

    My code is this way :

    register_sidebars(1,
        array(
            ‘name’ => ‘Sidebar Offers’,
            ‘before_widget’ => ”,
            ‘after_widget’ => ”,
            ‘before_title’ => ”,
            ‘after_title’ => ”
        )
    );

    function custom_sidebar_offers() {
        if ( is_category( ‘ofertas’ )  ) { ?>
       
       
           
               
                           
               
           
           

    <?php } }
    remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
    add_action('thesis_hook_custom_template', 'custom_sidebar_offers');

    When I apply it to pages, it works (as I can choose to apply custom template to pages from the admin panel), but with categories no way.
    I hope you can help.
    Thanks
    Christèle

    • http://www.berchman.com berchman

      @Clegeard
      your conditional statement is using “is_category”
      Try using “in_category” to see if that helps.

  • http://twitter.com/vmathanraj mathan

    How to rename the dynamic_sidebar() with generated_dynamic_sidebar()  Do you know how to rename this using hook or filter or something. Thanks for help.

  • http://twitter.com/igotkat Kat Tepelyan

    Hiya!

    Thank you for this. I am having a slight problem, tho, as WP bounces back ” Call to undefined function sidebar_3()” when I call sidebar3(); inside my function.

    I have registered the sidebar with the code you offer up top and have dragged widgets into it via visual editor, but I get this error. Which makes sense, because I don’t define the sidebar_3() function anywhere in the code. So how are you seeing the sidebar at all, when in your example you never actually define function sidebar_3() either?

    Am I missing something?

    Thanks in advance!
    Kat

  • Jonlenhart48

    hey, great article. I am having trouble. I am trying to make the thesis theme do s1-content,-sw2 and its not working. s1 just goes under the content and teh content does not move to the right. Can you help me!!! email me back at jonlenhart48@gmail.com if you can help!

  • http://www.facebook.com/bh4nu Bhanu Chawla

    Hi Berchman,

    Thanks for this great tutorial.

    One question though – if we use a custom sidebar template on Sidebar-3 page (as used in this tutorial), will this custom template be used on all the children pages as well (e.g. /sidebar-3/custom-page-1/)?

    Cheers

    • http://www.berchman.com berchman

      Hi Bhanu,
      No, the children pages should not inherit the custom template unless you select the template from the drop-down. Although if you wanted to get crafty, you might be able to write some PHP to do it automatically for you. Hope this helps.
      Thanks,
      Bert

  • Robert

    how does one remove a sidebar title, i would like to see it inside the widget page for reference but not on a webpage, thank you.

  • Pingback: Why and how to use the WordPress Theme Frameworks | Wordpress ArenaWordpress Arena

  • Pingback: Why and how to use the WordPress Theme Frameworks « Blog de xkortazar