Using SSI with 'the_widget' in header
-
Hi,
I’m on a MultiSite install (localhost) and am trying to incorporate the Simple Social Icons into the header without using a widget area. This way the social icons are on every subsite using the theme on the network.
The code I’ve pasted below does add SSI to the header, but when SSI is also in any active widget area, the header displays the settings for the widget in the widget area instead of the ones I’ve put in the code. Any ideas on how to make the settings in the header function independently of the ones in any of the sidebars?
//* Do custom header add_action( 'genesis_header', 'custom_do_header' ); function custom_do_header() { global $wp_registered_sidebars; genesis_markup( array( 'html5' => '<div %s>', 'xhtml' => '<div id="title-area">', 'context' => 'title-area', ) ); do_action( 'genesis_site_title' ); do_action( 'genesis_site_description' ); echo '</div>'; genesis_markup( array( 'html5' => '<aside %s>', 'xhtml' => '<div class="header-social">', 'context' => 'header-social-area', ) ); do_action( 'custom_social' ); genesis_markup( array( 'html5' => '</aside>', 'xhtml' => '</div>', ) ); }
And the supporting function for ‘custom social’:
add_action( 'custom_social', 'custom_social_content' ); function custom_social_content() { if ( !dynamic_sidebar() ) : the_widget( 'Simple_Social_Icons_Widget', array( 'new_window' => 1, 'size' => 48, 'border_radius' => 48, 'icon_color' => '#ffffff', 'icon_color_hover' => '#ffffff', 'background_color' => '#333333', 'background_color_hover' => '#003566', 'alignment' => 'alignright', 'facebook' => 'https://www.facebook.com/myfacebook', 'twitter' => 'https://twitter.com/mytwitter', 'youtube' => 'https://www.youtube.com/user/myyoutube' ) ); endif; }
Much thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using SSI with 'the_widget' in header’ is closed to new replies.