WordPress News & Notes - April 16, 2009

From time to time, I run across a number of very useful WordPress resources or interesting posts related to WordPress, which I share in my WordPress news and notes posts.   Here is a few that have caught my attention over the past month or so:

  • WordPress Optimization Bible -The WordPress Optimization Bible is a collection of useful tips and tutorials on how to speed up your WordPress site. If you ever experienced slow WordPress admin panel, “MySQL server has gone away” message, pages taking forever to load or you want to prepare your site for a major increase in traffic (for example Digg front page) this is the guide for you.
  • What’s in Store for WordPress Themes in 2009? - Justin Tadlock shares his thoughts on what he expects out of WordPress themes in 2009.   In my opinion, you’ll see many more premium WordPress themes, as well as a shift towards theme frameworks and child theme releases.   Click over to see what Justin is expecting!
  • 135+ WordPress Tutorials - Instant Shift has compiled another large collection, this time featuring a number of our WordPress Tutorials and our WordPress code page.
  • The A to Z of .htaccess - Alex of Nometech has published an excellent post covering a bunch of information about the .htaccess file.    Useful resource to bookmark for any webmaster!

Digg This | Stumble it |

How To: Add Images to WordPress Login/Register links

Have you ever wanted to use icons/images instead of plain text for Login/Register links on a WordPress blog? Thankfully WordPress allows a down to bone customization so you could say that almost everything is possible. Our technique is simply achieved by creating two functions and adding them to your theme’s function.php file.

To replace Log in/Log Out text with a desired image, simply copy the code below and make your functions.php file ready for editing (through WordPress Theme Editor or FTP),

//Image instead of text for the "Login & Log Out" links
function ax_login() {
$before = '<li class="axLinks">';
$after = '</li>';
$theme_url = get_bloginfo('template_url');
if ( ! is_user_logged_in() )
$link = $before . '<a href="' . wp_login_url() . '">' . '<img src="' . $theme_url . '/images/login.png" alt="Log in" />' . '</a>' . $after;
else
$link = $before . '<a href="' . wp_logout_url() . '">' . '<img src="' . $theme_url . '/images/logout.png" alt="Log Out" />' . '</a>' . $after;
echo apply_filters('loginout', $link);
}

Paste the code you copied and then submit/save the file. Pick two icons you like (the size it’s up to you to decide but names are relative to the code, see: login.png, logout.png) and upload them to your theme images folder. Reload your WP site and ta-da!!! There you see two new shiny icons you didn’t have before. This code applies to any situation, whether you do have or not the Meta Widget active.

What just happened?

This function will override the output of loginout filter, it requires you to have wp_loginout(); somewhere on  your theme where you want to show your login icon. You can even style it using CSS by adding the .axLinks{ } class to your theme’s style.css file, and then manipulate it as you desire. Here’s a small CSS block which gives only basic directions.

.axLinks li, a, img{
background-color: transparent;
list-style: none;
text-decoration: none;
border: 0; }

The same treatment can be applied to the register filter as well, with just some small necessary changes, of course a new functions needs to be created only to avoid confusion. Below you can find the code for Register/Site Admin links. Follow the same steps as with the function above.

//Image instead of text for the "Register & Site Admin" links
function ax_register() {
$before = '<li class="axLinks">';
$after = '</li>';
$theme_url = get_bloginfo('template_url');
if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . '<img src="' . $theme_url . '/images/register.png" alt="Register" />' . '</a>' . $after;
} else {
$link = $before . '<a href="' . admin_url() . '">' . '<img src="' .$theme_url . '/images/site_admin.png" alt="Site Admin" />' . '</a>' . $after;
}
echo apply_filters('register', $link);
}

This function will override the output of register filter, it requires you to have wp_register(); somewhere on  your theme, more precisely wherever you want your register/site admin icon. Now if you don’t have any pre-chosen icons, there are numerous choices out there.

This little modification has been tried and proven to work up to WordPress.2.7.1 and is intended to save you from editing the core, instead creating two easy-to-customize functions that can be delivered with your theme. If you encounter any potential problems feel free to ask by commenting below.  Cheers!

This was a guest post by Arian Xhezairi, a WordPress manic, web developer and Twitter user (follow him here!). You can also check out his site, iTechnologize.net. If you have WordPress knowledge and are interested in writing a post for WordPress Hacks, please contact us.

Digg This | Stumble it |

Collection of WordPress Comment Hacks

There are all sorts of WordPress hacks people can easily do to customize and improve both the look and functionality of their WordPress blog, but I’ve always felt that the comments section is one of the best ways to truly customize your WordPress theme.   After all, blogging is all about author interaction, and the comments go a long way towards conversations happening.

If you are looking to improve the comments field of your blog’s theme, Instant Shift recently took the time to feature a number of comment hacks, which can be viewed here.   Looks like they’ve already got 30 hacks included, including a few we’ve featured here in the past.

Digg This | Stumble it |

WordPress Launches WordPress.tv

Over the weekend I noticed that WordPress has launched a sweet new visual resource for their blogging software, which can be found at WordPress.tv.   As you would probably guess by the domain extension, WordPress.tv will provide video tutorials for both WordPress.org and WordPress.com installations.

If you look at it now, you’ll find a lot of extremely basic tutorials for people new to WordPress, but one cool thing is you can submit requests to see future WordPress video tutorials.  I would imagine over time you’ll start to find a lot more advanced WordPress tutorials.

Some other cool things about WordPress.tv:

WordPress.tv is also now the place to find all that awesome WordCamp footage that was floating around the web without a home. See the presentations you missed and get a peek at behind-the-scenes action. We call it WordCampTV.

You’ll also find slideshows of presentations made by Automattic employees and other WordPress gurus, plus interviews I’ve done with the media and fellow bloggers.

I hope you’ll consider WordPress.tv not just a support resource, but also a place to hang out and keep up with all the geeky goodness going on in the WordPress community. Tune in regularly for fresh content and updates to the WordPress.tv blog. Lots more is on the way.

Digg This | Stumble it |

WPMU Tutorials Releases a Installation eBook

Because I am not personally a WordPress MU user, it seems to be very rare that I talk about WPMU that much here at WordPress Hacks.    For those unfamiliar with WordPress MU, it is a multi-user version of WordPress, allowing you to control thousands of blogs with a single installation of WordPress.   This of course makes it ideal for blog networks, newspapers and magazines, or universities.

I know a number of our readers do use WordPress MU, so I wanted to let you know that our friend Andrea of WPMU Tutorials has taken her popular post and published the information in an ebook explaining how to install WordPress MU.  For people that are considering starting a network of blogs, you’ll want to check out this free ebook!

Digg This | Stumble it |