A VIDEO

Final instalment of the worst album covers ever made. 

A VIDEO

Some of the worst album covers ever made… enjoy, some more tomorrow :D

A TEXT POST

Delete files in your iTunes folder that aren’t in your library

Recently I had a bit of a mad clear out of my iTunes library, and ended up deleting about 25% of all the music I had because it was shockingly bad.

The problem is I deleted it from the library but I didn’t delete the actual files. Now, though I am getting a bit strapped for hard drive space, so I needed to get rid of the unused files.

Going through these folder by folder would take yonks, but a response given to a similar question on super user helped me to do it really quick.

First go to iTunes -> Preferences -> Advanced, then change your iTunes Media Folder location to somewhere different (probably best to make a new folder called tunes or something similar inside music).

Then, go to File -> Library -> Organize Library and then click consolodate library. This will then copy over all the files that are in your library to your new folder. Once this is done, delete your old folder.

Jobs a gudden.

A TEXT POST

Treehouse Raises Some Serious Funding

I’m an avid user of Treehouse, as someone who is relatively knew to the industry (less than two years, part time) it was been really useful in teaching me how to use some basic JQuery and PHP.

One of the downsides, I have found though is the lack of content, the website seems to cover the basics of almost anything really well, but there is very little else to move on to. Well, at the end of April Treehouse announced that they had raised $4.75 million in funding.

With this large input they are moving to Portland, Oregon to set up a new office and to expand to take on more writers, etc.

Check out Treehouse’s founder Ryan Carson on Twitter, the news article in Net Magazine or even better sign up for a Treehouse account now.

A TEXT POST

Adding a seperator to Wordpress menus - the right way

Whilst working on a Wordpress re-skin project the other day, the design showed a seperator between the links.

According to the Wordpress Codex page, you use the following function…

<?php wp_nav_menu$args ); ?> 


and pass either…

‘before’ => ‘seperator of choice goes here’

‘after’ => ‘seperator of choice goes here’

as arguments.

In the design, the seperator would be a vertical bar ( | ), so my code looked like…

<?php wp_nav_menu( array( ‘theme_location’ => ‘left-hand’, ‘after’ => ’ | ’ ) ); ?>

The only problem with this is it leaves a vertical bar after every link, even the last link where there is no need for it.


So, I stated searching for a solution to remove the last vertical bar dynamically. I came across an excellent tutorial on infiniteloops.net, which recommended the following steps…

Firstly, add span tags around our vertical bar…

<?php wp_nav_menu( array( ‘theme_location’ => ‘left-hand’, ‘after’ => ‘<span> | </span>’ ) ); ?>

Then add the following function to your functions.php file…

function nav_menu_add_classes($items){
$pos=strrpos($items,‘class=”menu-item’,-1);
$items=substr_replace($items,‘menu-item-last ‘,$pos+7,0);
$pos=strpos($items,‘class=”menu-item’);
$items=substr_replace($items,‘menu-item-first ‘,$pos+7,0);
return$items;
}

add_filter(‘wp_nav_menu_items’,‘nav_menu_add_classes’);</pre>
And the following code to your css file…
.menu-item-last span {display:none;}

And Bob’s your uncle, Fanny’s your aunt, one dynamically seperated Wordpress nav menu.



A VIDEO

I watched Noel Fielding’s luxury commedy last night. I one watched mighty boosh and I found it just baffling and not at all funny. However after about 30 seconds of watching this I was laughing till I felt sick. Noel Fielding must be on some serious drug. Here is a few screenshots I took to show you how random it is.

A TEXT POST

Wordpress Theme Development - Tidying up your Javascript

Whilst recently working on a (if I do say so myself) uberly epic wordpress theme which will shortly go on Theme Forest, I realised I had quite a few Javascript files loading in my header.php file and it looked quite messy.

Not only this but for some strange reason Wordpress wasn’t loading jQuery properly.

So I followed some advice found in an article written by Paul van Zyl (you can find it here), who had a good idea for disabling the standard wordpress script which loads in jquery, and write a simple function which registers and loads all of your Javascript when Wordpress initialises.

function flipstorm_javascript() {
    if (!is_admin()) {
   
        // DEREGISTER WORDPRESS JQUERY (IF ITS WORKING IN THE FIRST PLACE, MEH)
        wp_deregister_script(‘jquery’);
       
        // REGISTER OUR JAVASCRIPT FILES
       
        // jQuery 1.7.1 minified
        wp_register_script(‘jquery’, get_template_directory_uri() . ‘/js/jquery-1.7.1.min.js’, ‘jquery’);
       
        // Javascript for tabs - currently disabled
        // wp_register_script(‘tabs’, get_template_directory_uri() . ‘/js/jquery.idTabs.min.js’, ‘jquery’);
       
        // Responsive Slider
        wp_register_script(‘slider’, get_template_directory_uri() . ‘/js/jquery.flexslider-min.js’, ‘jquery’);
       
        // Wordpress’ showcase javascript
        wp_register_script(‘showcase’, get_template_directory_uri() . ‘/js/showcase.js’, ‘jquery’);
               
         // QUEUE OUR REGISTERED JAVASCRIPT FILES
        wp_enqueue_script(‘jquery’);
        wp_enqueue_script(‘slider’);
        wp_enqueue_script(‘showcase’);
    }
}
add_action(‘init’, ‘flipstorm_javascript’);

If you notice we register the function…

function flipstorm_javascript() {

and then below, we make sure that this isnt being loaded on an admin page…

if (!is_admin()) {

Now that we are sure this function is being loaded in the right place, the first thing we need to do is stop wordpress loading the latest version of JQuery. Loading the latest version is all well and good, but then when the latest version of jQuery comes out and nothing works on your site it turns into a bit of a pain in the backside. So by disabling Wordpress’ jQuery we know everyone who uses the theme will be running the same Javascript.

Disable Wordpress jQuery…

wp_deregister_script(‘jquery’);

Enable jQuery version of choice…

wp_register_script(‘jquery’, get_template_directory_uri() . ‘/js/jquery-1.7.1.min.js’, ‘jquery’);

Next we want to register all the Javascript we want to use, like so…

wp_register_script(‘showcase’, get_template_directory_uri() . ‘/js/showcase.js’, ‘jquery’);

Now that all of our scripts are registered, we want to load them…

wp_enqueue_script(‘jquery’);
wp_enqueue_script(‘showcase’);

All we have to do now, is tell Wordpress when to load this function. You could set it to load on wp_head, but we are gonna set it to load on init.

add_action(‘init’, ‘flipstorm_javascript’);

Thats it, jobs a gooden. Your javascript is now nice and tidy :D