The Easy Way to Add Widgets to WordPress Content

In my experience of building and maintaining WordPress web sites it is quite a common to want to put some related blocks of information into your main post’s or page’s content, inline. For example you might want to add a tag cloud or a list of related posts. This type of information is already available via WordPress widgets and of so you could add it to your sidebar (if you theme and template supported one). But what if you want to add the tag cloud into the middle of the post… like this;

[turbo_widget widget-prefix=tag_cloud&obj-class=WP_Widget_Tag_Cloud&widget-tag_cloud–title=My+Tag+Cloud&widget-tag_cloud–taxonomy=post_tag]

Wow, pretty cool eh?

So this is possible today using my 5* rated Widgets on Pages plugin. With the plugin installed you can create a new Widgets on Pages sidebar, add your Tag Cloud widget to it, copy the generated shortcode and then paste that into your content. But now it’s even easier…

Introducing Turbo Widgets

I’ve recently created a new plugin for WordPress, called Turbo Widgets. And with this, WordPress widgets can be added to posts and pages using the nice WYSIWYG editor… click, click, click, BOOM!

Turbo Widgets Demo

There’s a free version of the plugin available on the WordPress.org plugin repository that has this nice GUI for adding widgets and there’s also a premium version that supports the ability edit the widgets too, again using the TinyMCE WYSIWYG editor.

And Turbo Sidebars?

As well as this, the premium version also supports Turbo Sidebars. These are custom content areas that can hold standard WordPress content (text, images, etc) as well as widgets added through the Turbo Widgets features. These content areas can then also be added to posts and pages via shortcodes (soon through the WYSIWYG too) . You can also use template tags to add these Turbo Widgets to your themes templates, say for example adding related posts to the bottom of each blog page.

The documentation page for Turbo Widgets contains further info on how to use these, but I also hope to blog through their usage too in the near future.

WordPress London – March Meetup

It had been quite a long time since I last attended a WordPress  London meet-up, so I was very excited about going along again and getting a good fix of WordPress geekery (as well as chatting to folk and drinking beer of course). The event was held at Shoreditch Works Village Hall for the first time and it provided ample space and the required tech. The venue and pizza was sponsored by the following kind orgs;

The Talks

Joel Hughes – The Business of WordPress

Joel gave a passionate and honest account of his move from permanent employee, through contractor and freelancer and onto running his own agency. He covered some of the key mistakes that folk (including him) make when starting out in alone, and some notes on avoiding them (the second time perhaps). They include;

  • Undervaluing Yourself : On a personal level right through to pricing
  • Clients from Hell : Educate the good ones, they’ve probably not bought a website before. Fire the bad ones.
  • Business is Personal : If you’re a freelancer, BE a freelance; don’t pretend to be an agency if you’re not. If you do you won’t be authentic, and this will show.

Joel also did some shameless pimping of his The Business of Web Design conference, which I have to say has a nice looking line-up of speakers. I’d probably be going if we weren’t due a baby the week before.

He also asked for freelancers of all sorts to get in touch with him. Looks like business is good.

David Coveney – Let’s Move It

I have seen one or two of Dave’s talks before at various WordPress (un)conferences and after seeing his take on Baz Luhrmann’s “Everybody’s Free To Wear Sunscreen” I wasn’t sure what to expect next. He didn’t disappoint by starting the talk with some kind of body convulsions which, I think in popular culture, could be described as dance moves.

He then proceeded to talk us through some basics behind running a WordPress migration with as few hiccups as possible. He discussed various migration types (server to server, multisite to singlesite, domain swapping) and their various pitfalls. He also talked through a few tools which can make life easier. These included MySQL Workbench and his company’s Search/Replace plugin.

In true Coveney style he then plumped for a live demo of a site migration (server to server and domain swap)… the audience, of course, new the perils of live demos and were all waiting for the inevitable.

Don’t work with computers – Dave Coveney

And of course the inevitable happened. So much so infact that Dave’s new database that he was using in the demo ended up being named fuckit. He rode out all that the live demo-gods could throw at him with it finally succeeding. His parting words of advice were “Don’t work with computers”.

Stiofan O’Conner and Tim Clark  – GeoDirectory

Stiofan and Tim talked to us about GeoTheme and the move to a new GeoDirectory plugin that will be appearing on WordPress.org very soon.

They briefed us on the history and the direction they think the plugin is headed. How they want it to become and extendible product with multiple revenue streams. The plugin looks like it’ll be very powerful and is well worth looking at if you’re interested in building up any kind of location-based directory.

Parting words

The standard post-meetup beers were had in a hipster-filled pub just around the corner, and I had some lovely chats with old friends and new from the WordPress community. I heard from a couple of the guys and gals that there was a lot of work out there for a WordPress freelance dev… this is certainly good news with my resignation notice period winding down.

I certainly can’t wait for the next one.

From a Problem to 100,000 Downloads

It was 1054 days ago that I first wanted to place a WordPress widget into a post I was writing. Whether it was for a client site or personal one I can’t remember… the important thing is that out of the solution I came up with emerged the Widgets On Pages WordPress plugin.

The plugin has undergone very little change since it’s 0.0.1 check-in to the WordPress.org plugin repository but since then it’s had very favourable reviews and been included in several blog posts and conference talks. But more importantly, for today at least, it’s now been downloaded over 100,000 times!

It has a current rating of 4.7/5 and at the time of writing sits as the 105th most highest rated plugin on the WordPress.org repository. 105th might not seem too good but it should be noted there are over 23,800 plugins in the repo.

August wp-hooked Widgets Admin Write-Up

At the August Meet-up of the London based wp-hooked I talked on the topic of WordPress Widgets, and in particular the admin area for them (slides can be found here). The talk came from the view of a user (read not developer) of WordPress who wants to take advantage of all the wonderful chunks of code that already exist in the WordPress widgets ecosystem. This ecosystem is a constantly growing one with Widgets being developed and released on the WordPress.org repository all the time. For website users (e.g. site owners, authors, etc) to actually make use of these great blocks of logic it’s not a friendly place sadly. The legacy idea of Sidebars is one that still has a place but it’s the use of Widgets outside of these well-trodden widget areas that things start to get tricky.

Let’s CMS it ALL

Users are wanting the freedom to add widgets into posts and pages as inline content; they want to easily add widgets to footer areas for things such as recent post lists, location maps and recent tweets. All these things are available as widgets but for users are heavily theme-reliant when it comes to how many widget areas are available to them and where those areas are on their site. In my talk (it could hardly be called a presentation) I suggested several plugins that can help users on their way to achieving these things;

During the talk several other plugins were discussed;

  • Dynamic Widgets – Control which widgets to display in the sidebars for pages
  • Widget Logic – Control which widgets to display in the sidebars for pages
  • Multi Edit – Not really widgety but adds extra content blocks to posts and pages admin screens
  • Page Layout – Page Layout allows to define a page layout using widgets
  • Carrington Build – A premium build tool which gives an advanced admin “layout” UI which enables users to add “content modules” to pages which could be widgets.
Screenshot of the Carrington Build in action

 

What Next?

Although all these plugins seem to add some great support to users when it comes to having control of their sites’ layouts and in particular the use of widgets they all seem to be a bit lacking. As a group we discussed what the solution would look like if we were designing from the ground up… especially now that we knew there was a demand to have this extra level of control and advanced use cases… something that the WordPress guys wouldn’t have known about when initially thinking about widgets. We came up with the following points which would hopefully spur on some further thought and potentially create a great solution;

  • Users want to add widgets to posts and pages on the fly.
  • Do widgets need to belong to sidebars? My personal thinking here is that CPT could be used to replace sidebars altogether.
  • Perhaps Widget attributes could be stored in post meta data if that Widget instance belonged to a particular post.
  • Having a drag and drop, minimal interface via the editor would be good… we would want to avoid the use of shortcodes. Perhaps in a similar way to the method used for images?
  • Users want to easily add widget areas to existing themes
  • Users want to be able to control the layout of widgets within their posts and pages.

And so there we have it… we have essentially a loose spec for a killer plugin or modification to core.

And what of wp-hooked?

For my part I really enjoyed the opportunity to vent some frustrations I’d been having personally as well as seeing over and over again in the WordPress.org support forums. It was great to have some expert feedback from like-minded WordPress folk. Once again, of course, thanks go to Emily and Ross for organising and chairing and of course the Dachis Group for hosting us. I’m already looking forward to the Sept ’12 event… what can I say, beer, WordPress and friendly geeks are excellent bed-fellows.

Lanyrd Splat WordPress Widget Plugin

Last night I noticed that the Lanyrd event info that was meant to be listed in my blog sidebar was no longer working. I was, at the time, using the My Lanyrd Widget which was up to a time working well… but then I noticed it had just stopped working.

I had a quick browse on the Lanyrd site and noticed that had some official JS and code which could be used to display a badge on your site showing pretty much the same info as the above mentioned widget had been doing.

And so, after an hour or so of coding the Lanyrd Splat Widget plugin for WordPress was born. I immediately requested a repo on the WordPress.org site and as soon as this was approved my checked in the code and the Lanyrd Splat Widget was launched!

Lanyrd info as a WordPress widget
The Lanyrd Widget in action

The plugin has settings for the maximum number of events to show as well as the format and of course the Lanyrd username of the info to use.

Lanyrd Widget Settings
The Lanyrd Widget Settings

The plugin pulls the info from Lanyrd  every time the page is loaded, which is obviously not ideal. I had toyed with the idea of using the ics feed which Lanyrd provides and then using transient storage inside WordPress to temporarily cache the data. I decided to not use this for the time as the route I’ve taken pulls only the data needed and also supports richer data. My view on this may change in time… we will just have to see how this performs.

The Lanyrd Splat Widget can be downloaded from the official WordPress.org plugin repository.