Vary WordPress templates for different pages

Last Updated on Thursday, 5 August 2010 02:46 Written by Dan Thursday, 5 August 2010 02:46

It never hurts to read a manual, an FAQ or a Help page now and again. Whatever you know about a piece of software you’d be surprised what you can find out by going back over some instructions, maybe with a specific task in mind. My task was to create a number of templates for a WordPress-based website. Each template differed slightly from the other and would be used for pages in different categories.

So in WordPress it’s common to work with one theme or layout, with the front page possibly showing a newsfeed and then some other “pages” displaying less time-dependent content. So you might add a differing layout to the index and page elements of the theme. But then it’s possible to add other themed pages. reading the WordPress Codex page on Pages – http://codex.wordpress.org/Pages a useful tip is to add a couple of lines of code at the top of the file:

<?php
/*
Template Name: TemplateFile
*/
?>

Where TemplateFile is the name of your template. Add some other code and formatting such as the content, then the magic. Go into Pages > Add New and there’s now an option in Page Attributes for a Template in the dropdown list.

Learn More

New website for Trinity PR

Last Updated on Saturday, 19 December 2009 12:51 Written by Dan Thursday, 19 November 2009 06:59

Trinity PR website
A new version of Trinity PR’s website has gone live today at: www.trinitypr.co.uk with PHP and CSS by Dan Atrill, design by Hughes Design.

Learn More

New website – phase one

Last Updated on Saturday, 19 December 2009 12:57 Written by Dan Thursday, 5 November 2009 02:52

Phase one of a new website for London based Crewd Recordings goes live today.

Crewd Recordings website

You can find it at www.crewd.co.uk
Watch out for further developments very soon.

Learn More

New site launched

Last Updated on Sunday, 3 January 2010 01:33 Written by Dan Friday, 16 October 2009 02:01

A new site for AJ&L Electrics goes live today at www.ajlelectrics.co.uk. Designed by Hughes Design.

AJ&L Electrics

Check it out.

Learn More

New website, small contribution made

Last Updated on Sunday, 3 January 2010 01:35 Written by Dan Thursday, 25 June 2009 10:19

A new website for Acupuncture and Shiatsu practitioner Fiona Hurlock has just gone live at www.fionahurlock.com.

Built and designed by Hughes Design, I was asked to assist with some menus on the treatment page.

Fiona Hurlock Acupuncture & Shiatsu

The menus were quickly implemented using scriptaculous and css so that the menu element changed colour on hover and the arrow to the left changed to a down arrow when clicked using update(). The text “appears” using the Effect object and is hidden using the hide() function again when other menu items are selected. A speedy solution to getting the site live.

Learn More

php form handling multiple select entries

Last Updated on Sunday, 3 January 2010 01:34 Written by Dan Thursday, 14 August 2008 10:18

The problem: You need to use the result of a multiple select form element in your php script. Handling a $_POST request gives only one entry from the form element, not all those selected.
The solution: Use array name in form element name ie multiselect becomes multiselect[] or
<select name=”multipleselect[]“>
<option value=”0″>0</option>
<option value=”1″>1</option>
<option value=”2″>2</option>
<option value=”3″>3</option> , etc
then handle with
foreach($_POST['multiselect'] AS $multi) {
// code to deal with each selected item
}
A version of this was found in Using Arrays with Form Data in PHP in PHP 5 Unleashed by John Coggeshall

Learn More

@media 2008 London

Last Updated on Saturday, 19 December 2009 01:12 Written by Dan Thursday, 29 May 2008 09:56


An “all rights reserved” , and very slim-looking picture of me and Stuart Langridge, and a guy from Vivabit (sorry, I forgot your name) is here: http://flickr.com/photos/babau/2534705698/sizes/m/

atmedia, atmedia20008

Learn More

@media 2008 London

Last Updated on Saturday, 19 December 2009 01:17 Written by Dan Thursday, 29 May 2008 09:14

@media2008
@media hits London and it’s been great. So far I’ve been to talks by Jeffrey Veen on information design, the mapping of diseased Soho in the 1800s, the BBC beta sites & Clearleft, James Graham and Lachlan Hunt on HTML5, Andy Clarke on design from comic books and Stuart Langridge on understanding HTTP responses, 404 and more.
And the free beer afterwards helped. Met (again) Christian Heilmann, Jeffrey Veen, Stuart Langridge, the HTML5 boys, Rudi from Barclaycard, Ryan Taylor from Havoc Inspired, Paul Stanton from University of Leeds, Michael Rawling and John Resig (jQuery v script.aculo.us) – sorry John!
It’s been a great experience – the South Bank venue is a great setting and having seen some great bands in the Queen Elizabeth Hall and spoken word in the Purcell Room it’s a very cool place to be talking web.
Some guy took lots of pictures around the bar after the main do. Will try and track down his snaps later.
Roll on Friday.

atmedia, atmedia20008

Learn More

 

Learn Coding & Web Design at Treehouse

 

domain names

 

Brighter Planet's 350 Challenge

Archives

 

 

Sage UK Ltd

Designed by RocketTheme
WordPress is Free Software released under the GNU/GPL License.