Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------------------------------------------------------------------*/
- /* Widgets
- /*-----------------------------------------------------------------------------------*/
- function my_widget_shortcode( $atts ) {
- // Configure defaults and extract the attributes into variables
- extract( shortcode_atts(
- array(
- 'name' => '',
- 'instance' => '',
- ),
- $atts
- ));
- $instance = str_ireplace("&", '&' ,$instance);
- $args = array(
- 'before_widget' => '<div class="widget">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>',
- );
- ob_start();
- the_widget( $name, $instance, $args );
- $output = ob_get_clean();
- return $output;
- }
- add_shortcode( 'widget', 'my_widget_shortcode' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement