tallphil

Taking WordPress Menus back to basics

Tue, 6th Sep, 2011, 17:43:43  |  Category: WordPress

I was working on a project earlier where I was using the wp_nav_menu function in WordPress to create a menu. By default, WordPress creates menus which are wrapped in layers (<div>), an unordered list (<ul>), list items (<li>) and then a link (<a>). However, on this project I wanted to use jQuery UI to generate a navigation, and that required just links (<a> <a> <a>).

So, to strip out all of those extra HTML tags, I used the following javascipt (as I was already relying on jQuery and javascript anyway).

var newmenu = '';
jQuery("#nav ul li").each(function() {
	newmenu += jQuery(this).html();
});
jQuery("#nav").html(newmenu);

This works by firstly looping through all of the list items in my navigation layer, and copying their contents (the menu link) into a variable. Then, I replace all of the HTML contained within my navigation layer with that string. Easy!

Comment on this post

Chosen jQuery Plugin

Thu, 28th Jul, 2011, 12:08:27  |  Category: Website Design

I just came across the Chosen JavaScript plugin, thanks to a link on the excellent CSS-Tricks RSS feed. It’s a jQuery / Prototype plugin which turns regular HTML <select> dropdown boxes into functional uber-awesome units of happiness.

Continue reading

Comment on this post

Flickr Press

Tue, 19th Jul, 2011, 23:54:28  |  Category: WordPress, WordPress Plugins

I’ve been using the excellent Flickr Press plugin to display flickr sets on a website that I’ve been working on lately, and I made a few changes to make life easier. In case anyone else may find them useful, I’ve uploaded the modified plugin here for general use. I’ve notified the original author, so hopefully if he likes the changes they may be pushed in a future update. For now you can download it here.

Continue reading

Comment on this post

Flickr Badge

Fri, 8th Jul, 2011, 14:56:43  |  Category: WordPress, WordPress Plugins

I’ve been using the excellent flickr badge on a website lately, and decided that it would be nice to put the script in as a widget, with easy to update options to customise it. So, I wrote a quick plugin which does just that…

Continue reading

Comment on this post

Nike Better World

Tue, 4th Jan, 2011, 14:40:23  |  Category: Design

My new favourite website: nikebetterworld.com.

By Ian Coyle, found through css-tricks.

Comment on this post

Colour Schemes

Thu, 20th May, 2010, 12:46:48  |  Category: Design

I’ve found a couple of nice colour scheme generators lately, I just stumbled across Colour Scheme Designer 3, which takes an established concept (complement, triads etc) but packages it all in a lovely product which is really intuitive – it even allows you to preview the scheme for people with different types of colour-blindness. Another cool tool is Adobe Ideas – an app more for the iPad than the iPhone, it has a tool to automatically generate colour schemes from photographs that works really well.
I know I shouldn’t until all of my current jobs are finished, but I can’t help but find ideas for new websites popping into my head…

Comment on this post

Trinity Hall Boat Club Website

Wed, 28th Jan, 2009, 10:52:43  |  Category: Website Design

After a couple of months worth of work, the new Trinity Hall Boat Club Website is nearing completion…
The front end of the site took me about a week to create, but writing the code for the secure back end, where you can update basically everything that you can see on the site through a web interface, took a lot longer! Society websites at universities tend to live for as long as their creator stays at uni, but I’m hoping that the user friendly back end of this site will allow people to keep it up to date whether I’m around or not.

This site also has some useful features built in, such as users being able to book seats at Boat Club Dinners, and the collation of all of their information (college account numbers, phone numbers, ARA numbers) for easy society administration. Registered users can even search email addresses according to strokeside / bowside preference!

Now the site is live, I’m hoping that it will gradually come to life as it populates with content… We shall wait and see!

Comment on this post