Created
June 17, 2018 04:08
-
-
Save seothemes/2a91f9231fc4f360083c35de81635e92 to your computer and use it in GitHub Desktop.
Widget area shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_shortcode( 'widget_area', 'prefix_widget_area_shortcode' ); | |
/** | |
* Display widget area with shortcode. | |
* | |
* @since 1.0.0 | |
* | |
* @return string | |
*/ | |
function prefix_widget_area_shortcode( $atts ) { | |
$atts = shortcode_atts( | |
array( | |
'id' => '', | |
), | |
$atts, | |
'widget_area' | |
); | |
ob_start(); | |
genesis_widget_area( $atts['id'], array( | |
'before' => '<div class="' . $atts['id'] . ' widget-area"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
return ob_get_clean(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment