Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Being totally new to WordPress and (extremely) rusty with PHP, I'm having a difficult time figuring out how to add the Social Media Widget to my site's header. I'm using the Twenty Eleven theme, as I need the site to have no sidebars. Ideally, I'd like the social media icons to show up either above or below the site search box (image redacted for client's privacy):

Widget position

I've tried tutorials and have looked all over the web, but haven't been able to find anything that applies to my rather specific situation. Is this just too hard to do with this theme, and should I just go ahead and use icons instead of a widget? I'm pretty sure I can do this in functions.php and header.php, but how?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can throw a widget anywhere into your template (if you do not want to use sidebar drag + drop) by calling the_widget.

In your case you would need to put this in the appropriate spot (maybe header.php or menu.php), you will have to figure out where you want it.

the_widget('Social_Widget ', $instance, $args);

Please view the ref page on what can be used for $instance and $args (for example this is where you put the widget title, parameters, etc): http://codex.wordpress.org/Function_Reference/the_widget

You should just use a register a new sidebar though , on account of this plugin have tons of options.

share|improve this answer
    
When I register a sidebar in functions.php, how do I get it to call the correct widget? After it's registered, how do I actually call the widget from header.php or searchForm.php? –  AJ. Jan 31 '13 at 16:20
    
When you register a new sidebar it shows up in your admin under appearances, you typically just drag and drop a widget into it. –  Wyck Jan 31 '13 at 16:29
    
Oooh, now I get it. OK, so I've got the sidebar showing up and I drag/dropped the widget onto it, but it's not showing up. Do I need to specifically invoke the sidebar somewhere? How? –  AJ. Jan 31 '13 at 16:42
1  
Never mind, figured out that I need to use dynamic_sidebar with the widget ID. Thanks! –  AJ. Jan 31 '13 at 16:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.