- This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago by .
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Tagged: widget area
I have checked the official genesis tutorials for registering widget areas here:
The widget is registered fine. But the problem I am facing is to call the widget area. I tried the first technique which mentions to call the widget area by placing the code
genesis_widget_area( 'widget-name', array( 'before' => '<div class="div-class-name widget-area">', 'after' => '</div>',
in a template file. I used simple hooks instead of a template file. And it is showing
Parse error: syntax error, unexpected ';'
Finally I also tried the last way but it did not work too. The only way which worked was by using this in simple hooks:
<?php dynamic_sidebar( ‘widget-name’ ); ?>
But in this case, I cannot use div and I need to use div for some styling through CSS. So, could anyone please help on how to call a newly created widget area from inside simple hooks or from the functions.php where I can use the div tag.
Wrap the 1st snippet in PHP tags.
Looks like you're missing some code as well.
I am not at all good at php. But this was just the example. I had used the code
<?php genesis_widget_area( 'widget-name', array( 'before' => '<div class="div-class-name widget-area">', 'after' => '</div>', ?>
The code was directly copied from the Genesis tutorials in the register widget area tutorial inside my Studiopress account. So, not sure how I am missing code.
© 2023 WPEngine, Inc.