Tag Archives: widgets

Adding and Tracking Social Buttons

It seems like every website has social media buttons on them now. The ones leading the pack of late seem to be Twitter, Google +1 and the Facebook Like widget. This introduces one problem: loading times. Your pages are calling JavaScript files hosted on remote servers, bogging them down a bit.

Joost de Valk has put together a good tutorial on how to fix that issue. It features code snippets that will load the widget JavaScript asynchronously, keeping the buttons from holding up the page loading. Also, it even adds Google Analytics and Clicky tracking so you can tell if people are actually using your buttons.

When Google released +1, I quickly identified how to track interaction with that button. The obvious “follow up” was questions from people on how to track interaction with other buttons. Not for each of these social buttons tracking of interaction is actually possible. It depends on how the button was designed whether this will work or not. I got it working for Twitter and Facebook, so I’ll share the code for tracking interaction with their respective social buttons below.

Social Buttons: Adding them to your site & Tracking them [Yoast]

Using Shortcodes in WordPress Widgets

If you, like most WordPress users, have a widget-enabled theme, you probably have wished you could use shortcodes in them at one time or another. Many plugins allow you to add functionality to your posts via shortcodes, but for some reason they are not enabled in text widgets.

Fortunately, there is an easy way to turn on the shortcode parsing in widgets. Chris Coyier, over at Digging into WordPress, dug up a filter hook you can add to your theme’s functions.php file.

You have to wonder, though…why isn’t this behavior the default?

Shortcodes in Widgets [Digging into WordPress]

Twitter List-Powered “Fan Page” Widget

There’s a really neat post over at Tutorialzine on how to build A Twitter List Powered Fan Page.

It’s a little widget, that would go in your sidebar or some similar place, where it would display the Twitter avatars of anyone who wanted to click a button to add themselves to a Twitter List (along with an overall count of the “fans”).

It seems like a neat idea, though you have to do a bit of PHP and JavaScript work to get it up an running. (It would be nice to see a variation made as a WordPress plugin…)

Managing Widgets in WordPress 2.8

The new widget management in WordPress 2.8 is greatly improved. You can drag widgets from the available widgets area to any widgetized sidebar, and edit the settings with a click of the little arrow. There’s no more annoying “Save” button for you to have to remember to click either.

The only problem? As soon as you drop a widget into a sidebar, it appears on your blog. That means one or two visitors might see an unconfigured widget before you have a chance to edit and save the settings. (This was brought to my attention recently by WP Weekly.)

Luckily, there’s a workaround…

Continue reading →