Monthly Archives: September 2010

Jquery – Target blank links

Do you use the target=blank attribute on links? If yes, you might know that XHTML 1.0 Strict don’t allow it. A good solution to this problem should be using JQuery to make links opening in new windows:

$('a[@rel$='external']').click(function(){
  this.target = "_blank";
});

Usage:

<a href="http://www.whileifblog.com/" rel="external">Whileifblog</a>

Jquery – Lazy load content for speed and SEO benefits

Another way to speed up your page loads and neaten up the HTML that search spiders see is to lazy load whole chunks of it using an AJAX request after the rest of the page has loaded.

The user can get browsing right away and spiders only see the content you want them to index.

We just put all that HTML in a static page and use the load() function to load it in once the DOM was ready.

Example:

$('#forms').load('content/headerForms.html', function() {
  // Code here runs once the content has loaded
  // Put all your event handlers etc. here.
});

Read more »

WordPress – Modify dashboard footer text

Another good tip for those who create WordPress themes for clients is to modify the WordPress dashboard footer text, and add (for example) a link to your support forum.

The only thing you have to do is to copy this code and paste it in functions.php:

function remove_footer_admin () {
    echo "Your own text";
}

add_filter('admin_footer_text', 'remove_footer_admin');