104 Responses

  1. Themelit
    Themelit November 9, 2010 at 1:31 am |

    Luckily all our themes we’re building are build off some awesome framework called Hybrid Core.

    ;)

    Reply
  2. Javier Márquez
    Javier Márquez November 9, 2010 at 3:17 am |

    Oh yes, theme developers, please, read this post!! I completely agree with it, some themes lacks on define the sidebars properly and it is no so hard to do things in the correct way. This is a great tutorial, and a must read for a theme developer.

    I made a plugin (custom sidebars) for creating all the sidebars you need easily from the admin area, a functionality that i think WP should have out the box, and its main issues are related with themes that doesn’t use correctly the dinamic sidebars.

    Wordpress has a great potential with its widgets and sidebars, we can push it much further.

    Reply
  3. Barrett Golding
    Barrett Golding November 9, 2010 at 6:28 am |

    excellent tut, as usual. but shouldn’t ‘after_widget’ close the tag, like this:
    'after_widget' => ''

    Reply
    1. Barrett Golding
      Barrett Golding November 9, 2010 at 6:31 am |

      make that:
      'after_widget' => ''</div>"

      (you have a tag opener: <div>)

      Reply
  4. Ed Nailor
    Ed Nailor November 9, 2010 at 8:19 am |

    Justin,
    Thanks for the information. Its always interesting to get the opinions from some of the main developers as to what could be done better.
    I consider myself more of an intermediary developer. I have a pretty good handle on how WordPress works, a fairly good understanding of PHP as a language and the ability to research things I am unsure of. Recently I began working on my own framework for the many projects I develop, and in doing so decided I wanted a framework I could be proud to share with others. I wanted to make sure the coding was clean and used the most up to date techniques and functions WordPress offered. A lot of what I have used in the framework I found in the TwentyTen theme.
    I personally would LOVE to hear more about the issues you are seeing in WordPress themes. While I do not feel my framework is quite ready for release to the public yet, I am striving to make sure it is of top quality and this type of feedback is great!
    Thanks again.
    Ed

    Reply
  5. Ed Nailor
    Ed Nailor November 9, 2010 at 8:42 am |

    Justin,

    I was just doing some research on something I want to do with widgets, and look what I ran across:

    http://codex.wordpress.org/Widgets_API#Display_Sidebar_on_Theme

    Here, the WordPress Codex gives the exact “if(function_exists)” setup that you mention as outdated. This may be a big reason you are seeing this so much still… the basic WP documentation still references it.

    Maybe this should be addressed?
    Ed

    Reply
  6. Ed Nailor
    Ed Nailor November 9, 2010 at 9:22 am |

    On that note, what I am looking to do with widgets is something similar to what you were trying to do a year or two ago (damn, you are so far ahead of me!)

    For styling purposes, I want to allow each widget to have its own unique class when the user adds the widget. Since I won’t know what the widgets will be, I can’t call the specific widgets in the css. It seems you were looking for a way to add even and odd classes to the widgets. Did you get anywhere on that? Or, even better, do you know of anything (code or plugin) that will allow a user to add a specific class (possibly by dropdown, field, etc) to each widget as they are adding the widget?

    I use the Widget Logic plugin quite a bit, so ideally something similar that would allow the addition of a class (such as “red”, “dark”, “highlight” or similar terms added to the css) that would specify how that one widget should look would be perfect. Any help or push in the right direction would be helpful.

    Thanks
    Ed

    Reply
    1. Jamal Mohamed
      Jamal Mohamed November 11, 2010 at 1:30 am |

      Ed, you can style each widget differently without using a plugin, yes, as long as you correctly follow the steps detailed in this post by Justin.

      Look at this code:

      'before_widget' => '<div id="%1$s" class="widget %2$s">',
      'after_widget' => '</div>',

      The above code creates a div container that wraps the content of the widget. This code also assigns a unique id to every widget, so if I add a text-widget in the primary sidebar, WordPress will assign it a unique id to the container div that wraps the widget. If you view the source of the new created text-widget you’ll see an HTML code like this:

      <div id="text-3" class="widget widget_text">
      <p>I am a text widget.</p>
      </div>

      Now you can open your style.css and style the widget with the id text-3.

      Reply
      1. Ed Nailor
        Ed Nailor November 17, 2010 at 9:28 am |

        @jamal: I am aware of this option, but that does not allow the user to apply a class on the fly.

        Let’s say that in my CSS I have 2 classes for sidebars. One would have a dark frame, the other a light frame. If I am developing a theme that anyone could use, I won’t know going in that they will be using a specific text widget and want that widget to have a dark frame. So I would not know ahead of time which ID would be applied to which widget.

        I could use multiple sidebars, and with each sidebar add a unique style. However, what I am envisioning is allowing the user to decide as they add the widget how it would be displayed.

        I know that in using the Widget Logic plugin, this plugin adds a box that allows variables to only show on certain pages using functions such as is_front_page() or is_page(8). However, I would love for the user to also be able to add a specific class in the same manner.

        So since I do not know what the widget ID will be ahead of time, I need something flexible that allows the assignment of a predetermined style class to be applied as the widget is added.

        Anyone with this solution, I would love to see it!

        Thanks
        Ed

    2. Ed Nailor
      Ed Nailor November 17, 2010 at 9:21 am |

      Hey Justin,
      I know you are a busy guy, but I was wondering if you have any comment on adding specific classes per widget. I would love to find a way to make this happen… any thoughts?
      Ed

      Reply
  7. Scott Lee
    Scott Lee November 9, 2010 at 10:06 am |

    Justin, as always you have provided clear direction.

    Thank you so much for the excellent “tutorial”.

    Reply
  8. Ryan
    Ryan November 9, 2010 at 10:28 am |

    There are cases where get_sidebar() might not be appropriate for a specialized theme, but it’s something I’ve rarely seen.

    One of the shortcomings I’ve found with the args to these include functions is the lack of support for subfolders. Things get pretty messy with a big site when your forced to namespace your filenames rather than organize your includes into folders.

    Any thoughts on this?

    Reply
  9. Let’s update those sidebars | WereWP
    Let’s update those sidebars | WereWP November 9, 2010 at 10:32 am |
  10. Stefano
    Stefano November 9, 2010 at 10:32 am |

    @Justin, great article as usual!

    @Ed: I’ve done some research on “custom syle” for widget too… and while we can easly hook in the widget admin screen to ad checkbox or dropdown for adding options, it looks like the “show widget” logic doesn’t contains any hooking capability to add custom tag or anything else.

    The logic that display the vidget simply outputs the “before & after widget”, “before & after title” with an echo statement, so you can’t hook neither there.

    Maybe I’m missing something… Justin? ;-)

    Stefano

    Reply
  11. Randy
    Randy November 9, 2010 at 10:47 am |

    This is a great article. I really like when people mention ways to customize and work with the “native” features of Wordpress. Many developers seem to think they need a 3rd party plugin for unique content areas which could easily have used a custom sidebar. I see that even in expensive themes.

    One last note on why to use “get_sidebar” instead of include is because WP will gracefully default if that sidebar template is missing for some reason which is better than seeing php errors on the page.

    It is funny how slightly misleading some of the WP naming conventions can be. I wonder if it were called “dynamic_module” it would be more realized these can be anywhere and even in multiple locations. Same goes for Custom “Post” Types. It really isn’t a “Post”.

    Reply
  12. Michael
    Michael November 9, 2010 at 12:10 pm |

    Thanks for another great eye-opener Justin.

    And, as previously mentioned by Barrett, would not the div-tag be “closed”? Or have i overlooked something?

    [code] 'after_widget' => ''"[/code]

    Reply
  13. This week’s article roundup. Tune in!
    This week’s article roundup. Tune in! November 9, 2010 at 12:42 pm |
  14. Jeff
    Jeff November 9, 2010 at 1:25 pm |

    Hey Justin. Thanks for your post. I always find your posts to be thorough and straightforward. They have helped me to make my custom WordPress framework theme much better.

    In this case you busted me on 2 of the bad examples (unnecessary backwards compatibility check and not using IDs). So it’s back to work I go. Thanks again.

    Reply
  15. Ed
    Ed November 9, 2010 at 6:39 pm |

    @Stefano if I could access the widget interface to add a drop down that could be attached to and called with each unique widget, I could use it to add a div around the widget, correct? That would give the ability to target widgets within that class, right?

    I am not sure how to access the widget interface so if you can point in the right direction it would greatly appreciated!

    Reply
  16. Paul
    Paul November 10, 2010 at 3:58 am |

    No, this is not the Yet-Another-Blog-Post-About-WP-Sidebar

    This is the best one !

    Thank you very much for all the comprehensive WP articles here.

    Reply
  17. Sami
    Sami November 10, 2010 at 11:00 am |

    I was just making my sidebars for the first time, so this was right on spot. Thank you!

    Reply
  18. Jeff
    Jeff November 10, 2010 at 12:41 pm |

    I especially found the “Collapse sidebars without widgets” part helpful for allowing empty sidebars to validate when using unordered lists as the widget containers.

    Reply
  19. Jamal Mohamed
    Jamal Mohamed November 11, 2010 at 1:54 am |

    I was recently thinking why people check if the function register_sidebar() exists, which was present in the WP core since 2.3 as I guess. This is something I guessed you’ll talk about when you mentioned “bad sidebar code” earlier in this post.

    Also I’m against this aimless backward compatibility check which really harms the way we develop themes and plugins. In this case, we’re only helping hackers by making end-users stick with their old WP installations.

    As for using <li></li> tags in before_widget and after_widget, I’d choose the <li></li> over the <div></div>, as the former one seems more semantic and can support Microformats easily.

    Reply
  20. Steve Mortiboy
    Steve Mortiboy November 13, 2010 at 4:25 pm |

    Another great post. Thank you Justin.

    I’ll be very interested to read your other future related posts like how to “create dynamic widths for your content depending on which sidebars are active/inactive” and what other common mistakes you’ve found with themes.

    Reply
  21. links for 2010-11-14 | zota
    links for 2010-11-14 | zota November 14, 2010 at 4:02 am |
  22. Weekly WordPress Review - WPCanada
    Weekly WordPress Review - WPCanada November 15, 2010 at 3:44 am |
  23. Prevent Senior
    Prevent Senior November 15, 2010 at 9:17 am |

    Excelentes dicas nesse blog adorei….

    Reply
  24. Elia Durban
    Elia Durban November 15, 2010 at 7:20 pm |

    I’m not a designer of theme but I’m interested in what you said to be: downright nasty code. What does that mean and how do I know.
    Thank Justin

    Reply
  25. dee8
    dee8 November 16, 2010 at 10:31 pm |

    great post Justin, informative and straight to the point.

    Reply
  26. How to load files within WordPress themes
  27. Pierre Saïkali
    Pierre Saïkali November 19, 2010 at 4:08 am |

    Useful post about sidebars, thanks for sharing!

    Reply
  28. Ronny
    Ronny November 19, 2010 at 7:50 am |

    Is there a way to have sidebars per posts? A major dealbreaker for me, is the lack of adding widgets on a per post basis (for example info boxes, relevant entries etc). WordPress is a very fluid and dynamic publishing tool, but lacks basic features like this.

    How would you solve this?

    Reply
    1. Mike
      Mike November 22, 2010 at 1:41 pm |

      Great article – thanks, Justin. @Ronny, I just published this super simple graceful sidebar plugin which enables you to create custom sidebars for your posts or pages. Simply install the plugin, create two custom fields in your post called “graceful_title” and graceful_content” with the title and content you wish to have displayed in the sidebar. Next, drag the Graceful Sidebar Widget to your theme’s sidebar and you’re good to go.

      Enjoy!

      Reply
  29. Correct Coding for WP Sidebars | BloggingPro
  30. peter
    peter November 30, 2010 at 2:32 am |

    I have created some widgets.By using the default theme of wordpress, I am able to show those widgets either in sidebar or footer. What I need is to show them in the centre..that means where we normally place the contents, but I don’t know how to do…I think I should customize this template.I don’t want to use some other themes, rather I would like to use the default twenty ten theme. Can anyone help????

    Reply
  31. Julien
    Julien January 8, 2011 at 4:10 pm |

    Great article thank you! Will all the tools available to make themes a lot of creators are falling short when it comes to sidebar content and management.

    Reply
  32. SlowX
    SlowX January 12, 2011 at 9:11 pm |

    What if a widget has no title and I want to skip the ‘before_title’ and ‘after_title’?

    Reply
  33. Prospress templating how-to | Canadian Pickers
  34. marquex
    marquex February 7, 2011 at 6:17 am |

    @SlowX The way that widgets are displayed depends on each widget particulary, so if they have no title some of them will display the before/after title code, but others don’t.

    Notice that before/after title are properties that belong to a sidebar, not a widget, you will have to define for the sidebar, so you don’t know when its widgets will have title or not.

    Having a look at the code i realize that there is an action hook which is called before the widget is printed

    do_action( 'the_widget', $widget, $instance, $args );

    maybe using it you will be able to disable all the befor/after title stuff.

    @Justin, I have linked this tutorial from inside my sidebars plugin, because it rocks!!

    http://wordpress.org/extend/plugins/custom-sidebars/

    Cheers!

    Reply
  35. Djolhan
    Djolhan February 9, 2011 at 6:32 am |

    Here is an excellent page for the sidebar. Have found exactly what I search for correctly Widgeting a template ;)

    Thank you for this excellent work.

    Reply
  36. Jesse Taylor
    Jesse Taylor February 26, 2011 at 1:39 pm |

    Amazing article. Thanks so much for taking the time to write this!

    Reply
  37. Margarida
    Margarida April 10, 2011 at 1:51 am |

    hi,
    I am using a theme from WPSHOWER and I just noticed that the sidebars do not have an ID.
    here is the code:

    if (function_exists('register_sidebar')) {
        register_sidebar(array(
            'name'=>'Site description',
            'before_widget' => '',
            'after_widget' => ''
        ));
        register_sidebar(array(
            'name'=>'Sidebar',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => ''
        ));

    Can I add an ID manually now that the site is already running with a lot of pages and posts or will it just ruin everything?

    And thanks for the tip.
    Maga

    Reply
  38. A
    A June 10, 2011 at 11:42 pm |

    So, now that the function ‘unregister_sidebar’ is deprecated, how do I unregister it in a child theme short of deleting the register code in the parent theme?

    Reply
  39. Chris J
    Chris J July 19, 2011 at 3:01 pm |

    Hi Justin,

    I have a theme that I inherited, so I don’t fully understand everything in it.

    In functions.php, there is a call to register_sidebars with a single sidebar definition, and this has the correct format, so looks fine.

    There are two sidebar template files called sidebar.php and leftsidebar.php. These are added to the theme in index.php using 2 calls to locate_template, first with leftsidebar, then with sidebar.

    Both of these files have a call to dynamic_sidebar (as well as a bunch of unrelated stuff). The one in leftsidebar is the one that is defined in register_sidebars in functions.php.

    The strange thing is that both sidebars show up in the admin, and I can add widgets to them both. So the question is, why does the second dynamic_sidebar work, even though there is only one sidebar defined in register_sidebars in functions.php ?

    Reply
  40. Chris
    Chris September 9, 2011 at 9:35 am |

    I am incredibly grateful to you for the clarity of this post. As soon as I clear my plate, I am going to read through all of your posts! PLEASE keep writing!

    Reply
  41. Sidebars in WordPress - Justin Tadlock
    Sidebars in WordPress - Justin Tadlock September 26, 2011 at 4:41 am |
  42. Tempur
    Tempur October 8, 2011 at 11:29 am |

    Umm, is there any plugin to install and do all that to me?! I mean I’m not into so it won't be so easy for me...

    Reply
  43. Widget Logic is_active_sidebar fix | Spigot Design
  44. dave
    dave November 13, 2011 at 9:11 pm |

    Note: The section with the heading “Arguments for dynamic_sidebar()” actually describes arguments for register_sidebar().

    Reply
  45. John Bolyard
    John Bolyard November 21, 2011 at 9:54 pm |

    Justin – I’m not a developer so I’m encountering a problem I’m having trouble solving.

    I have a dynamic sidebar and I want to style the “Archives”. I don’t know where to look for the actual code for the “Archives” as it displays from the widget to my sidebar.

    Make sense? Any help would be greatly appreciated!

    Great article btw – thanks!

    Reply
  46. Brent
    Brent November 25, 2011 at 3:53 pm |

    This is fantastic! But when I register the new widgets, in the back-end, the widget handlers are automatically added to the top. In other words, when I go into appearance –>widgets, those show up but at the very top. Is there any way to control what order they do in?

    I appreciate your help.

    Reply
  47. Chelsea
    Chelsea December 7, 2011 at 11:21 pm |

    Hi Justin,

    Great tutorial – Thank you so much! I am new to Theme Development and I was overwhelmed with the number of different ways to create a diff sidebar for diff pages. Thanks for taking the time to clarify the good/bad code!

    I followed the instructions and my new sidebar appeared on the page, woohoo! I am experiencing a problem though :(

    Now, if I edit a page and hit the ‘update’ button, the screen goes white, while the URL redirects to /wp-admin/post.php. The screen stays white, until I hit the back button & changes are not saved. I log out & when I try to login the screen is white.

    I am developing a child theme for WP Twenty Eleven. So I:
    1. Registered the new custom sidebar in a new functions.php in my child theme folder
    2. Added dynamic_sidebar( ‘sidebar-custom’ ) in new file sidebar-custom.php
    3. get_sidebar( ‘custom’ ) in pages.php

    It seems to me that the functions.php file conflicts with the Parent theme’s function.php file – because when I remove it the site works fine again…but of course no dynamic sidebar…

    I would much appreciate if anyone has any suggestions for me. Thanks heaps in advance.

    Reply
  48. Peter Shackelford
    Peter Shackelford December 9, 2011 at 5:10 pm |

    Is there a simple way to place our newly created sidebar using a hook? Rather than editing the template file, can we register the sidebar and attach it to a specific place in your theme? All in a functionality plugin.
    Peter

    Reply
  49. Jacob Begun
    Jacob Begun December 28, 2011 at 12:30 pm |

    Hi Justin,

    I just a new guy in the Wordpress world.
    I try to fix the sidebars with the : { position: fixed; } code line.
    It was good only for one sidebar, but I want to fix also the second one, because I use right and left sidebars. So when I use the code for the second sidebar, the template changes to only one sidebar. I work with the Weaver II Pro.
    Maybe you have some idea about it ?
    Thanks a lot,
    Jacob

    Reply
  50. Felixius
    Felixius January 5, 2012 at 12:23 am |

    Thanks Justin!

    The codex can sometimes be as clear as mud.

    Without bloggers like you, I would be completely clueless instead of somewhat clueless… ^_^

    Reply
  51. Moaaz
    Moaaz January 5, 2012 at 9:18 pm |

    many thanks to you.
    that was very useful. :)

    Reply
  52. Shaggy Dog Story | Flarnie Marchán
    Shaggy Dog Story | Flarnie Marchán January 19, 2012 at 2:48 pm |
  53. Tobias Wagner
    Tobias Wagner February 24, 2012 at 1:20 pm |

    Great post. Thank you so much. Among all the posts I’ve googled for creating sidebars, this one is probably the best explained and covers pretty much everything.

    Reply
  54. Bob
    Bob March 15, 2012 at 2:37 pm |

    Good post.

    I was looking at this as I built a child theme on twentyten. I notice in that theme, they call two sidebars in the same sidebar.php file. Of course, they don’t really function as two sidebars from the perspective of a viewer or even a user of the theme — since they are more or less just stacked on top of each other.

    Any idea why it’s set up that way?

    Reply
  55. Bob
    Bob March 15, 2012 at 4:52 pm |

    So if you weren’t going to use widgets in a sidebar (in a custom dedicated theme for something) you wouldn’t have to register it as a sidebar at all, right?

    You could then just use get_template_part to call it onto a page? Or would that be considered not good practice?

    Thanks again for a great blog. Glad I found this.

    Reply
  56. Jim
    Jim May 18, 2012 at 11:41 pm |

    Why are these called sidebars? They should be called widget areas.
    I have placed these in the header and footer not just on the sides of the page.

    Reply
  57. milton friesen
    milton friesen June 19, 2012 at 12:29 pm |

    Justin, maybe this is the wrong place to ask it, but you mention just dropping functions in the functions.php without adding actions. But in child themes, adding actions results in errors. So is just dropping the functions in okay the? or should we use filters or alternative action commads there?

    Reply
  58. sara
    sara June 26, 2012 at 12:33 pm |

    thank you for this tutorial! I’m a theme developer and a WordPress newbie and this tutorial is a real eye-opener as another commenter said before, thanks again, it helped clarify some of the issues I didn’t understand before, this page has been bookmarked! :) Thanks again :)

    Reply
  59. Casey
    Casey July 12, 2012 at 1:34 pm |

    You win! Great article, I fixed my problem. Following tutorials that never get updated are there full of errors had me searching everywhere for a sidebar tutorial. Thanks!

    Reply
  60. Andy MacLeod
    Andy MacLeod July 22, 2012 at 5:47 pm |

    Great tutorial – and I’m reading it nearly two years after it was written.

    Thanks!

    Reply
  61. Brett
    Brett August 24, 2012 at 9:26 am |

    Great article – good reading!

    Just a little confused though. You mentioned that for dynamic menus you need to call them via the dynamic_sidebar() function; however then further down you mentioned that..

    “For the best organization of your theme and separation of code, you would create a specific sidebar template for each of your dynamic sidebars. Suppose you created two dynamic sidebars with the IDs of primary and secondary. To best organize these, create both a sidebar-primary.php and sidebar-secondary.php template for handling those sidebars.

    You would use the code below to load both of these sidebar templates:

    So I am confused….. which do I use to display a dynamic sidebar?

    Thanks!

    Reply
  62. nightsmusic
    nightsmusic September 3, 2012 at 3:57 pm |

    Well, I came here to see if I could find any information on why your My Life template won’t show the secondary sidebar, no matter what I’ve tried. Unfortunately, I don’t see anything that helps. Rather than show the sidebars next to each other, they’re showing the main sidebar at the top of the column and the secondary sidebar below that.

    Really lovely template, but if I can’t get a three column layout, I can’t use it.

    Reply
  63. nightsmusic
    nightsmusic September 3, 2012 at 6:14 pm |

    That’s okay. I thought your post above might give me some insight, but everything checks in the code. I didn’t do the Theme Hybrid site because it’s $29 a year and I just wondered about this one thing.

    It really is a very nice template, like I said, lovely design. I just can’t use it then. But thanks!

    Reply
  64. Trisha
    Trisha October 5, 2012 at 4:05 pm |

    Great tutorial, however I’m having a problem with WP ver. 3.4.2….

    Even though I am certain that my code to register the sidebars is correct, and the sidebars are getting registered fine (and allow me to put widgets where I want them), they are not rendering correctly.

    I’m using DIVs, not LIs, as you show above, but the WP code is still rendering my widgets wrapped in the li tag, not the div as I’ve specified…..

    This is very frustrating…..any suggestions?

    Reply
    1. Trisha
      Trisha October 6, 2012 at 4:57 pm |

      Sorry, I just figured out that I used a hyphen in place of an underscore, making my own problem…..that’s what I get for typing instead of copying & pasting…sigh….

      Thanks again for posting this tutorial.

      Reply
  65. Jim Camomile
    Jim Camomile October 23, 2012 at 3:44 pm |

    Awesome article as usual. I really enjoy reading your stuff. It is incredibly well laid out and never wastes words. THANKS!

    Reply
  66. Christian Haynes
    Christian Haynes November 2, 2012 at 9:52 am |

    This is a great resource if you use Wordpress as a CMS. The steps were detailed and worked flawlessly in my implementation. Thank you for your hard work!

    Reply
  67. Josh
    Josh December 24, 2012 at 8:17 am |

    Excellent Tutorial. I’ve been trying to find one like this that takes me through step-by-step for some time now and this was it!

    On a side not, I’m not sure if you have already created a tutorial on this but I would like to know how to enable the ability to choose which sidebar you want to display on individual posts. If you have one that you could send me a link to or are willing to write one, that would be awesome! Thanks!

    Reply
  68. vaibhav
    vaibhav December 28, 2012 at 10:22 am |

    How to develop an unlimited sidebar function for wordpress theme?

    Reply
  69. Donald
    Donald January 18, 2013 at 4:14 am |

    this is awsome thank you, followed lots of vidio tutorial and were not helping. when I found this tutorial trust me I am the worlds hapiest man. thank you

    Reply
  70. Oliver
    Oliver February 8, 2013 at 4:49 am |

    This is very informative. Everything I need to know about sidebars I find here. Thank You!

    Reply
    1. Pattie
      Pattie February 20, 2013 at 8:58 pm |

      I am FAR from a whiz at WP so here goes and pls pardon my ignorance. I have repeatedly read that the only way to add a second sidebar is to initially edit the functions.php – doing that totally froze my site. I had to go back and edit. So – if I want to add a 2nd sidebar directly under the current (I’m using Soho Serenity theme) can I do that without creating and uploading sidebar2.php?

      Reply
  71. katana leigh
    katana leigh March 23, 2013 at 7:50 pm |

    How do I tell the stylesheet what to do with the new widgets? They are all floating off center.

    I would like to style them now :D

    Reply
  72. Anna Lam
    Anna Lam April 1, 2013 at 7:44 pm |

    Awesome tutorial! This tutorial was very easy to follow and saved me from hours of stress.

    Reply
  73. Evgeny
    Evgeny April 14, 2013 at 7:28 am |

    Good post!

    Reply
  74. pieter goosen
    pieter goosen April 16, 2013 at 2:17 am |

    Excellent article. Good to know I’m doing thinks the way it should be done.

    I’ve got one question, I’ve registered a new sidebar and created a file called sidebar-main.php. I’m currently working on a childtheme of twenty twelve. Is there a way I can change get_sidebar() to get_sidebar( ‘main’ ) without copying all the relevent files to my child theme and editing thing, something I can use in my functions.php file

    Many thanks

    Reply
  75. 13 Great Sites for WordPress Tips, Tutorials, and Hacks | mStudiosTALK

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.