I just prettied up my blog’s sidebar using the Social Media Widget for WordPress. Pretty simple little plugin for adding nice looking social networking icons to your sidebar that link to your personal pages (i.e., my “Follow Me” section). Easy to install, easy to configure. But if you are anything like me, you are handsome, smart, smell terrific, and are never satisfied with the out-of-the-box version of anything. I wanted my icons aligned horizontally, not vertically. I also wanted them in a different order. Neither was configurable, so I got under the hood and made a few small source changes.
To get the icons aligning horizontally in my theme I added “display:inline” to the following classes in social_widget.css:
After that I wanted the icons in a different order. To do this I actually had to get into the PHP for the widget. Luckily the changes were simple. All I had to do was cut and paste the specific sections for each icon into the order I wanted. For example, your social-widget.php file will have a section that looks like this:
123456789101112131415
<?php// Facebookif($facebook!=''){?><a href="<?phpecho$facebook;?>" <?phpecho$nofollow;?><?phpecho$newtab;?>><img src="<?phpecho$smw_path;?>images/<?phpecho$icon_pack.'/'.$icon_size;?>/facebook.png" alt="<?phpecho$title;?> on Facebook" title="<?phpecho$title;?> on Facebook" <?phpif($animation=='fade'||$animation=='combo'){?> style="opacity: <?phpecho$icon_opacity;?>; -moz-opacity: <?phpecho$icon_opacity;?>;" <?php}?>class="<?phpecho$animation;?>" /></a><?php}else{echo'';//If no URL inputed}// Twitterif($twitter!=''){?><a href="<?phpecho$twitter;?>" <?phpecho$nofollow;?><?phpecho$newtab;?>><img src="<?phpecho$smw_path;?>images/<?phpecho$icon_pack.'/'.$icon_size;?>/twitter.png" alt="<?phpecho$title;?> on Twitter" title="<?phpecho$title;?> on Twitter" <?phpif($animation=='fade'||$animation=='combo'){?> style="opacity: <?phpecho$icon_opacity;?>; -moz-opacity: <?phpecho$icon_opacity;?>;" <?php}?>class="<?phpecho$animation;?>" /></a><?php}else{echo'';//If no URL inputed}?>
Now say you, like me, wanted the Twitter icon before the Facebook icon. All you have to do is swap there position in the file and they will show up in the desired order:
123456789101112131415
<?php// Twitterif($twitter!=''){?><a href="<?phpecho$twitter;?>" <?phpecho$nofollow;?><?phpecho$newtab;?>><img src="<?phpecho$smw_path;?>images/<?phpecho$icon_pack.'/'.$icon_size;?>/twitter.png" alt="<?phpecho$title;?> on Twitter" title="<?phpecho$title;?> on Twitter" <?phpif($animation=='fade'||$animation=='combo'){?> style="opacity: <?phpecho$icon_opacity;?>; -moz-opacity: <?phpecho$icon_opacity;?>;" <?php}?>class="<?phpecho$animation;?>" /></a><?php}else{echo'';//If no URL inputed}// Facebookif($facebook!=''){?><a href="<?phpecho$facebook;?>" <?phpecho$nofollow;?><?phpecho$newtab;?>><img src="<?phpecho$smw_path;?>images/<?phpecho$icon_pack.'/'.$icon_size;?>/facebook.png" alt="<?phpecho$title;?> on Facebook" title="<?phpecho$title;?> on Facebook" <?phpif($animation=='fade'||$animation=='combo'){?> style="opacity: <?phpecho$icon_opacity;?>; -moz-opacity: <?phpecho$icon_opacity;?>;" <?php}?>class="<?phpecho$animation;?>" /></a><?php}else{echo'';//If no URL inputed}?>
And there you have it. With a few simple tweaks I got the Social Media Widget looking just how I want it. Oh, and while I was writing this post I added the WP-Syntax Plugin for WordPress. It is responsible for the sweet syntax highlighting in all the code segments. I highly suggest it for anyone adding code to their WordPress blogs.