“Secondary sidebar widget area” in WordPress Genesis child theme

I’m learning WordPress, specifically working with the Genesis theme, and finding it fascinating. I came across this issue, and I didn’t see any solutions posted online (although I find it reported by several people). I’m proud to say that I think I’ve found a solution.

The Problem:

A weird sidebar called “Secondary Sidebar Widget” area was appearing on certain pages in one of my Genesis child themes. It wasn’t appearing in the Genesis Sample Theme, and it wasn’t appearing in a different free Genesis theme I had downloaded. In this sidebar, instructional text suggested: “You can add content to this area by visiting your Widgets Panel and adding new widgets to this area.” However, when I went to the Widgets Panel, no Secondary Sidebar Widget existed!

Eventually, I came to realize that this “secondary sidebar” was linked to the “Default Layout” setting under “Genesis Settings.” The theme which displayed the “secondary sidebar” lacked the “Default Layout” panel. I could switch themes back and forth, and watch the “Default Layout” appear and disappear. I suspected something in the buggy child theme was causing the Default Layout option to disappear. I wondered that if I could somehow gain access to the Default Layout, maybe I could select the “full width” option, and it might fix the problem.

The Solution

After some searching through the “functions.php” file in the child theme, I found these lines of code:

genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar' );

It looks like the child theme is “unregistering” (or deleting) the items in the Default Layout section. Sure enough, if I commented out those lines, the Default Layout would appear, with the options that I commented out (plus the “full width” option).

As you can see, the first line refers to a layout with content on the left, two sidebars on the right; second one is two sidebars on the left, content on the right. Et cetera. When the child theme unregisters them, they disappear. When I commented out all five of them … my six Default Layout options appeared.

Now, there may be a good reason for this; maybe the theme author didn’t want the user to be able to change the layout. However, I believe in my case somehow the “wrong” layout was selected in the system, maybe when playing around with a different child theme.

In my case, I commented out only the last two items, which left me with three options in the Default Layout:

When I selected the rightmost “full width” option in WordPress, voila! The sidebar disappeared!