Visually split the primary sidebar in Genesis into two further sidebars, each with their own widget area. For more info about genesis_register_sidebar() see the StudioPress tutorial on How to Register a Widget Area.
PHP
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
CSS
| 1 2 3 4 5 6 7 8 9 10 |
|

Hi,
I tried using this on one of my sites and I keep getting this error: Parse error: syntax error, unexpected $end in C:\xampp\htdocs\wordpress\wp-content\themes\copyblogger\functions.php on line 90 is there something I am missing? I am only getting this once I install the code in my functions file.
Thanks
“Unexpected $end” usually means that a closing } is missing. I’ve updated the post to use code hosted at Github, so you can try clicking the “view raw” link, and ensure you copy and paste all of it.
In-genius.
I floated both left extended the width to 300px and was able to change the background colour of the widget in that SideBar.
Thank You Thank You Thank You
This needs to be more step by step, because I still can’t get it to work. I can register the widgets fine. It’s the code above it. Where does it go? Because I keep getting errors no matter where I put it.
Hi Autumn,
All of the PHP code (registering of sidebars, and the code above it) goes into your functions.php, so just copy and paste the whole lot there.
The CSS code obviously goes into your style.css file (see the bottom right of each code block to see the filename).
Awesome! Just what I was looking for! I’d like to place the split widget area somewhere in the middle of the sidebar area, then resume the single column widget area. How would I accomplish that? (or am I being too greedy?)
You won’t be able to continue the top widget area, but you could just add in the markup and registration for a new widget area that follows after the split sidebars. See https://gist.github.com/3811839 (where I’ve renamed the split section from
sidebar-bottom-*tosidebar-middle-*, and added a newsidebar-bottom). Since thesidebar-bottomwon’t have any styles to make it half-width, it will naturally expand to be the full-sidebar-width.Fantastic. Thanks Gary. I can’t wait to implement this!
Hi Gary,
I’m trying to implement your solution for Bill, above, on a blog I’m working on. The sandbox site is up at http://freehomeschooldeals.theblogmaven.com . The child theme I’m using is News; when I add the code to functions.php, it breaks the site. I’d love to be able to add this split sidebar, though! Would you mind taking a look? I can send you the functions.php for the blog if you need it.
Thanks!
Jeni
Hi Jeni,
Did your sandbox site throw any errors? If it included line-numbers, how do they relate to the code you’ve pasted in?
(Remember, that you likely won’t need the opening
< ?php- that's just to get the code displaying here with correct syntax highlighting.)Gary,
Is it possible to execute this using hooks? I don’t mind changing my code but I may end up wanting to go back to a single sidebar later and I find it easier to do it through hooks.
Hi Katy,
This solution does use hooks – specifically the
genesis_after_sidebar_widget_areaaction hook, as seen at the top of the code snippet.Gary
I have been looking for this and I was so excited to find it but I can’t seem to get it to work. I pasted the top part from raw into Genesis Custom code, php and the css into same css area. I have Genesis Prose. Not sure what I’m doing wrong but the new areas do not appear in my widgets area.
Hi Gary-
I left a comment yesterday but I think it got wiped. I used this code as instructed (I have Genesis Prose, I put the php stuff in custom code php and css in custom code css). But the new widgets do not appear. Any advice?
Gary- nevermind – got it!