Archive for December, 2009

WordPress 2.9

Saturday, 19 December, 2009

WordPress stickerWordPress 2.9 just got released, and according to the official WordPress development blog,  it is awesome! Here are the main features of the new version:

  1. Global undo/”trash” feature, which means that if you accidentally delete a post or comment you can bring it back from the grave (i.e., the Trash). This also eliminates those annoying “are you sure” messages we used to have on every delete.
  2. Built-in image editor allows you to crop, edit, rotate, flip, and scale your images to show them who’s boss. This is the first wave of our many planned media-handling improvements.
  3. Batch plugin update and compatibility checking, which means you can update 10 plugins at once, versus having to do multiple clicks for each one, and we’re using the new compatibility data from the plugins directory to give you a better idea of whether your plugins are compatible with new releases of WordPress. This should take the fear and hassle out of upgrading.
  4. Easier video embeds that allow you to just paste a URL on its own line and have it magically turn it into the proper embed code, with Oembed support for YouTube, Daily Motion, Blip.tv, Flickr, Hulu, Viddler, Qik, Revision3, Scribd, Google Video, Photobucket, PollDaddy, and WordPress.tv (and more in the next release).
  5. Themes can register “post thumbnails” which allow them to attach an image to the post, especially useful for magazine-style themes.
  6. Custom post types have been upgraded with better API support so you can juggle more types than just post, page, and attachment. (More of this planned for 3.0.)
  7. Upgraded TinyMCE WYSIWYG editing and Simplepie.
  8. Create custom galleries with the new include and exclude attributes that allow you to pull attachments from any post, not just the current one.
  9. When you’re editing files in the theme and plugin editors it remembers your location and takes you back to that line after you save. (Thank goodness!)
  10. Registration and profiles are now extensible to allow you to collect things more easily, like a user’s Twitter account or any other fields you can imagine.

As you can tell, this version has really improved the functionality greatly for users as well as developers. And with the compatibility checking it saves users of a lot of trouble. I dare not imagine the goodies included in the forthcoming 3.0 version. There’s gonna be a party!

What are you waiting for? Download WordPress 2.9 and give it a run!

The world’s best collection of tiny icons

Sunday, 6 December, 2009

SILK ICONS set

I have had the best collection of 16×16 pixel icons in my hard drive all this time and I did not realise it. The guy who made them is an icon God. Seriously, after downloading this set, you will never need to search for 16×16 pixel icons again. So without further delay, may I present you, famfamfam.com’s SILK ICONS set.

That guy did an amazing job, we should all donate some money to him ;)

Creating a second sidebar for WordPress

Sunday, 6 December, 2009

wp sidebar editorNote: If you cannot do this on your own because you don’t have the needed knowledge, you can hire studio nocturnart to do the dirty work for you for a small charge. Just use the contact form!

Sometimes, one WordPress sidebar just isn’t enough! for example, on the nocturnart.com website which is used as a CMS I need a generic sidebar for the CMS part and another one for the blog functionalities like archives, categories, meta etc. Who knows, maybe I will need more at some point. In this case, with a little bit of tweaking the PHP, we can add multiple sidebars to our WordPress powered website and use them as needed. Here’s how:

Step 0: Locating or creating the functions.php file

First of all, we need to view and edit our functions.php file which registers the sidebars. This file must be under /[wordpress_directory]/wp-content/themes/[our_theme_name]/functions.php. If you don’t find it there, that means it does not exist for the theme we are using. Create one locally, open it and paste this inside it:

<?php
if ( function_exists('register_sidebars') )
register_sidebars(2);
?>

Now save the file and upload it. All done? Good, go to step 2. If there was a functions.php file proceed to step 1.

Step 1: The sidebar registration

If there was a functions.php file we need to edit it. We can do that simply by using the WP theme editor (make sure you have given writing permissions to the file). You can also download it and edit it with any text editor (notepad for Windows, Dreamweaver or gedit for Linux -  you gotta love gedit!). In the file we need to find this:

if ( function_exists('register_sidebars') )

Found it? Good. Take a good look at the code after that. Look for:

register_sidebars(2);

If this call exists you are almost all set, this means you already have 2 sidebars registered and you need to work on the second one. Go to step 2. If you don’t see these lines of code paste:

<?php
if ( function_exists('register_sidebars') )
register_sidebars(2);
?>

Step 2: Building the sidebars as we want them

At this point we should have two sidebars registered. Take a look at your theme files (by now you should know where they are loceted). Do you see something like sidebar2.php or another name that implies a second sidebar? You are actually done! Just use the Appearance -> Widgets menu, select the second sidebar and add/remove content! Then either call sidebar.php or sidebar2.php or whatever they’re called in the theme files you need to edit, using

<?php include (TEMPLATEPATH . '/sidebar.php'); ?> or <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

If there is no file implying a second sidebar, create one, and paste this inside it:

<div>
<ul>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
<?php endif; ?>
</ul>
</div>

You may need to tweak that code depending on your theme structure. Now upload and again use

<?php include (TEMPLATEPATH . '/sidebar.php'); ?> or <?php include (TEMPLATEPATH . '/sidebar2.php'); ?> in your theme files.

All done! Use the widget editor to add and remove widgets to your sidebars!