Widgets: The New Mobile Asides
August 25th, 2006
Widgets seem to be the latest craze. So, what are they? What do they do? How can I get my hands on one? And why are they so important to the average Blogger / website owner?
Widgets are a niffy little plugin that allows the drop and drag approach to placement of PHP code and WordPress functionality into your sidebar without having to know HTML or Web Design. This is what Automattic had to say about their new Widget invention for WordPress:
Widgets are an easy way for you to arrange and rearrange your sidebar to your hearts content without touching a line of code [….]
Widgets are an innovative and highly mobile plugin that allows you, dear reader, to put whatever you like in your sidebar, even customised sidebars, without having to know HTML. If you want to display an archive based calender or Meta information into your theme’s sidebar you can with ease. It’s dead easy.
Sidebar Widgets Plugin comes with the ability to “drop and drag” a multitude of different and useful components into your sidebar, as well as your customized sidebars all from the one Admin >> Presentation >> Sidebar Widgets page. Things like: Archives, Calender, Links, Categories, Meta Tags, Pages, RSS 1, Recent Comments, Recent Posts, Text Boxes, etc…. How simple is that?
Additionally, if you want more than one text box to display useful information or pictures or PHP or HTML, (limited only to your imagination) you simply nominate how many boxes you want (1 - 10) then drop and drag the boxes into your sidebar in the order you want them to display and presto! Text Box city.
I use the Sidebar Widgets throughout my website, but I’m a little discerning in how I use them. I’ve heard people use the sidebar widgets to generate their entire sidebar contents. Of course, this can be done with little fuss. Crafting your entire sidebar using Sidebar Widgets would, certainly, allow you to customise your website / blog on a daily basis if that’s what tickles your web blogging elbow.
Personally, I use the sidebar widgets to display interesting and up-to-the-minute information that’s “outside” my standard sidebar content. Information such as New Authors; Just Released Book Titles; Latest Comments; New Book Covers, etc. My “main” sidebar content such as, navigational elements and branding image/logo remain untouched and coded into my templates. I like knowing that my navigational elements and branding are in the exact same place on every page throughout my website and not dependant on a plugin for display. Sometimes, being a Cautious Nelly gives a sense of structure and peace to the chaotic web design world. And, if for some reason I wish to disable the Sidebar Widgets plugin, I can without altering my navigation and branding structure.
Okay. I’m Sold. How Do I Get Widgets Into My Sidebar?
Sidebar Widgets, like any other WordPress Plugin, must be placed on your server and activated via the WordPress Admin >> Plugins panel. Here’s the steps to get it up and running:
Sidebar Widgets
- Download the plugin from Automattic: Sidebar Widgets
- Extract all folders onto your desktop
- Open the Widgets folder and remove the “Classic” and “Default” folders.
- Upload the Widgets folder to your plugins folder = WP-Content >> Plugins folder
- Go to Wordpress Admin >> Plugins and activate the Sideabar Widgets plugin
- Simple. Done. Finished!
Wait A Moment. We’re Not Finished
Take a look inside the “Classic” and “Default” folders that came with your Sidebar Widgets plugin. You’ll see two PHP files. One = function.php and the other is sidebar.php. What they do, and what you should do is explained below.
Vanilla Install
Classic Theme Without Modifications
Without modification means that you haven’t altered your sidebar.php which came with one of the two preinstalled WordPress Themes: Classic or Default. On that premise:
- Upload both files (functions.php & sidebar.php) to your Classic folder
- WP-Content >> Themes >> Classic
- Now you’re finished uploading.
Default Theme Without Modifications
- Upload both files (functions.php & sidebar.php) to your Default folder
- WP-Content >> Themes >> Default
- Now you’re finished uploading.
Your Own Theme
- Upload functions.php to your current theme folder
- Did you notice you only upload one file? Of course you did! Good catch!
- WP-Content >> Themes >> Your Current Theme
- Now you’re finished uploading
Modified Themes
If You’re Using Classic or Default Theme
What do you mean by modified? Well, that’s a very good question!
In this context, a modification is any change you’ve made to your vanilla (untouched) Classic or Default theme Sidebar.php to suit your needs. The information in which you’ve added to the sidebar.php prior to uploading this plugin could be wiped when you re-upload the supplied sidebar.php in the plugin.
Don’t forget that if a file already exists in your theme folder, and you replace that file with an original file, then what modifications you’ve added will be over-written by the newer version. Wiped Out. Gone Forever! So take care.
So if you have modified your sidebar, with PHP or additional HTML or plugin PHP, then you’ll need to do things manually.
Manual Changes
Classic & Default Themes
It’s easy. Truly!
- Go to Admin >> Presentation >> Theme Editor >> Your Current Theme
- Select Sidebar template
- Make sure you have correct permissions. eg: CHMOD 644 or 666 depending on your hosting provider
- Decide where you want the Sidebar Widget information to appear in your web page. I inserted the code inside my “RightNav”. You can place it wherever you like, as long as its inside your sidebar.
- Code:
<?php if ( function_exists('dynamic_sidebar') && !dynamic_sidebar() ) : else : ?> - Save your Sidebar template.
- That’s It! How easy was that?
How To Use Your Sidebar Widgets
Using your sidebar widgets is easy as dropping and dragging the available widgets into your sidebar. When you go to: Admin >> Presentation >> Sidebar Widgets page, you’ll see your sidebar as well as available widgets you can add. You’ll also see the option to create more text boxes with the drop down box. Just select how many boxes you’d think you’ll need and click Save. You can change (increase or decrease) the number as you wish. The page will display your nominated text boxes for you to use at will.
If you hover your mouse cursor over any one of the available widgets you’ll notice that your cursor changes into a Cross. Right click to “snag” the object, then “drag” the object into your sidebar. You can swap and change the order of items whenever you wish.
For a more thorough explanation on how to use the plugin, see Automattic Sidebar Widgets How To for more information.
Subscribe to Comments via RSS Feed