Deferred and Asynchronous Script Loading with Javascript

Javascript

It’s a widely known fact that page speed is an important factor in most search engines’ ranking algorithms, Google has categorically stated as much in their developer guidelines.

Google’s goal is to provide users with the most relevant results and a great user experience. Fast sites increase user satisfaction and improve the overall quality of the web

Plus, we are all instinctively aware that visiting a site which loads faster is a much more pleasant experience than one which takes several seconds. A factor that should make page speed a priority regardless of any benefit to search engine ranking.

Scripts block the rendering of a page until each has been parsed in turn by the browser. Therefore, deferring the loading of non-essential scripts until after the page has loaded is a critical step in optimising a users experience of your site.

Ignoring Files in a Subversion Repository

Subversion

Oftentimes, with Subversion it’s pretty handy to ignore the status of files in your working copy. Cache files or other auto-generated data files can quickly become a pain to other users of your repository.

If you’re using SASS for example, that creates a lot of cache files in the .sass-cache folder that can take a long time to checkout and generally make the place look untidy especially when you’re viewing your svn status.

Git has the useful .gitignore file, but you can do the same tricks with Subversion it’s just not quite so obvious.

When including files within your WordPress theme use locate_template() to allow them to be overridden by child themes.

locate_template() will search for the file within STYLESHEETPATH and TEMPLATEPATH, returning the path as a string if it exists.

WordPress

Organising WordPress Themes – Partial Templates

WordPress

The root directory of your WordPress theme can get pretty crowded pretty fast as a project get steadily more complex. One thing that I found used to frustrate me was differentiating at a glance, my partial template files, from my page template files, from all the others that find their way in there.

De-cluttering your workspace makes it easier to spot items you require at a glance, helping you to avoid losing concentration whilst you’re working.

This becomes especially true when you start collaborating on a project, using task runners and css pre-compilers. All these things can make a theme fairly bulky, so if you know where everything is going to be in advance then it can help to speed up your work process.

Other articles in this series

  1. Organising WordPress Themes – Partial Templates
  2. Organising WordPress Themes – Setting Up a Compass Project