Community Forums › Forums › Archived Forums › Design Tips and Tricks › Problems adding widgetized area to home page on Mindstream
Tagged: add widget area
- This topic has 8 replies, 2 voices, and was last updated 10 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
May 24, 2013 at 11:45 am #42500FutureExpatParticipant
Hi all,
I'm trying to add a widgetized area to the home page of Mindstream for a slider. I'm registering the widgetized area just fine. Added the following code to the end of the functions.php file:
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => __( 'Home Slider', 'mindstream' ),
'description' => __( 'This is the home slider section.', 'mindstream' ),
) );This is fine and gives me a widget to use.
However, every time I try to add the hook I get down for service or configured incorrectly error message. I've tried adding the hook at the end of functions.php, just before the register widget areas. Following advice on one of Brian Gardner's tutorials I tried adding it at the beginning of the file, but I just keep getting the same error.
Here's the hook:
/** Add the slider section */
add_action( 'genesis_before_content_sidebar_wrap', 'add_home_widget_area' ); function add_home_widget_area() {
if( is_home())
dynamic_sidebar('home-slider');) );
}Please understand this is code I've lifted from various places as I am positively not a programmer and can't create it for myself. I'm a good cutter and paster though!
Appreciate any/all help. This is driving me somewhat crazy as I've been able to add similar widgetized areas to other sites before without any problem.
http://narrowboatsfornewbies.comMay 24, 2013 at 6:33 pm #42533Brad DaltonParticipantPlease see this solution http://www.studiopress.community/topic/adding-a-widgeted-sidebar-under-content/#post-42528
Nicks code works but you may have missed some of the code when you copied and pasted it. You also need a conditional tag for your home page.
May 24, 2013 at 7:58 pm #42546FutureExpatParticipantThanks Brad,
I know just little enough to be dangerous, so let me confirm a couple things with you before I proceed.
1. In the hook where your example shows
add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_before_content_home_widget', 5 );
what would I put instead of your "wpsites" and what does the numeral 5 signify?
2. If my widget is called Home Slider with the ID home-slider, then wherever you have
before-content
I would substitute home-slider, is that correct?
Thanks,
Susanna
May 24, 2013 at 8:50 pm #42550Brad DaltonParticipantYou can leave wpsites there or change it to anything your like.
And you can also change all instances of before-content to home -slider or leave it as well.
May 25, 2013 at 3:10 am #42580Brad DaltonParticipantMay 25, 2013 at 2:21 pm #42623FutureExpatParticipantHi Brad,
The good news is, I added the code and it didn't result in any error messages this time. The bad news is, I still don't have a home page slider.
I'm using the Genesis Responsive Slider. It's not the problem - I tossed it into a different widget area and it worked fine. But somehow the widgetized area just isn't being created.
I'm using the Mindstream theme.
Here's a link to the code I actually used.
(How do you do that fancy embedding thing?)
I guess not getting a fatal error is progress. . . but very frustrating.
I appreciate your help.
Susanna
May 26, 2013 at 2:00 am #42661Brad DaltonParticipantLooks like you changed the name to home-slider but didn't change all of them. Please use the original code which I embedded above and it will work as I have tested it. Thanks
May 26, 2013 at 1:12 pm #42706FutureExpatParticipantGreat help from braddalton! Thanks.
May 26, 2013 at 10:13 pm #42752Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.