WordPress Single Post Templates

I’ve just been building a site (http://www.nowlive.sg) and came across the need to output the post content dependent on the category it was in.

Anyone familiar with WordPress will know about using page templates, will know the immense benefits of having this facility, but now equally the ability to control more than one post template too. I predict this maybe become a standard feature to WordPress in the near future, as it saves having to call the category in php manually, or hashing your functions.php

A nice drop down box appears in the post edit screen which gives you or the client an option to select the right template for that post.

 

Full credit goes to Nathan Rice for writing this plugin.  http://twitter.com/nathanrice

Posted in Wordpress | Leave a comment

976px Page Width / Grid System

Just looking into designing some micr0-sites for work, and looking at changing the existing with of 960 to encompass the use of widescreen video (16:9).  Lot’s of interesting points here. The first is that there are optimum widths for displaying video at 4:3 and 16:9. http://www.flashsupport.com/books/fvst/files/tools/video_sizes.html

This led me onto using a slightly wider width to this particular design, with the intention of:

1: Testing new layout methods

2: Increasing page width as a result of the stats we had from our analytics.

This led me onto the BBC’s Global Experience Language Document, which is a huge investment into how the BBC display it’s contents online. http://www.bbc.co.uk/guidelines/gel/downloads/GEL_styleguide.pdf. This will show you how they consider all elements on their pages and how the 976 grid is the choice for them. By using 61 16px wide margins, it offers much choice and flexibility when it comes to dynamic layouts.

This for me is a great choice, being as I have personally used the 960 Grid system http://960.gs/ for a few years now. Let me know what you think, and if you have any other suggestions to this.

Anyway, for anyone that needs a template – I’ve uploaded one here: http://www.jayhughes.co.uk/976-Grid.psd

Posted in Design | Leave a comment

Firefox 4.0 – Test Drive

I’m currently test driving Firefox 4.0.1 and it’s compatibility with such add ons and tools like Firebug and Web Developer Tool Bar. I think it will be interesting to see how many people convert to this and how other developers find it.

http://www.netmarketshare.com/browser-market-share.aspx?qprid=0

This article shows that IE still holds roughly half of the market share, and with Firefox and Chrome having developer/open source capabilities – we really have to question how far this dominance will reach.

Of course, this is on a global scale, http://gs.statcounter.com/press/firefox-overtakes-internet-explorer-in-europe-in-browser-wars this article was release in January stating that Firefox was dominant in Europe which is certainly good news for UK developers.

Posted in Firefox | Leave a comment

25 Examples of texture for web design

I was looking into red-designing my music blog this evening and thought I’d look into using some texture for my logo design. I came across this link http://webdesignledger.com/inspiration/25-excellent-examples-of-using-texture-in-web-design and thought I’d share. I’m not trying to hot link here, I think anyone trying to look at a design from a fresh perspective (as I am here) should consider looking into the use of texture.

Some might say this technique is possibly the latest fad in web design of this decade, however I think all must agree that it adds so much more to the user experience by adding depth and field to any element your designing.

I’ll keep you updated with my results.

Posted in Design | Leave a comment

PHP – show/hide content in relation to the file

Came across a nice bit of code that essentially allows you to show/hide content based on whether your on that particular page.

<?php
   $thisFilename = end(explode('/', $_SERVER['PHP_SELF']));
   if($thisFilename == 'buy-now.php' || $thisFilename == 'register.php') {
	echo '';
   }
   else {
   echo '<div id="buy-now-header">';
   }
?>

So what does this do? Well essentailly this code requests the file name that your currently on from the server. Then there is an ‘if’ statement to check if the file is the one you want. In the example above, it uses TWO pages, ‘buy-now.php and ‘register.php’. In this example, if you are on either of those pages, there will be nothing displayed.

If your not on those pages, we can display some code.

Why might you use this? Well I was working on funneling some users through to payment, in my case I don’t want to distract users or deter them from making that purchase. Equally, I do still provie options to return home, I might want to remove a link to the page they are already on for example.

Posted in PHP | Leave a comment

Iframe Scroll Bars in IE7

Just handled an issue by where I’m using an iframe to run an Ajax email submit form. IE7 still showed Scroll bars even though you set the surrounding <div> to “style=”"overflow-x/y:hidden;”.

The solution comes actually with the file that your ‘iframing’ to. In my case it was an index.php file within a sub directory. Add <body style=”overflow:hidden;” scroll=”no”> to your body tag and it will remove the scroll bars within IE7.

Posted in IE | Leave a comment

How the heck do you use wordpress

http://forr.st/~LDU

Alex Pierce is a member of Forrst and he asked a simple question relating to how you go about learning WordPress as more than a blogging tool.

My answer:

“I think once you get your head around creating your own templates within WordPress, it will give you a greater understanding of how the ‘loop’ works within the model. (PHP)

I fully suggest you run the install, and then immediately try to create your own ‘template’. Templates show you how to customize your content in however which way you want, and incorporate what WordPress already gives you ‘out of the box’.

Immediately you’ll cross many bridges that will teach you about what WordPress has to offer (i.e. widgets and plugins etc) but you then get to fall back on what you should already be up to scratch with, and that’s good, clean semantic HTML and CSS.”

Posted in Forrst, Wordpress | Leave a comment

WordPress Media Library Problems

I experienced a problem today which I thought I might share.

I had to pull a site I have built from development to LIVE (root folder as I used a sub directory on their existing site to develop the new one). I moved the site over successfully, something I have done many times before with no hassle. However this time, all of the images in the Media Library were missing. One of those head scratching moments, go through the checks i.e. database correct, folder linked to correctly (you can check via Settings > Media > in your wordpress admin panel).

The problem for me turned out to be a .htaccess file on the root of the ‘uploads’ folder. For now I have removed it, and all images appear. Now I need to run further checks to see if this was a plugin I have installed or simply apart of the wordpress installation – but a quick win for anyone scratching their heads!

Posted in .htaccess, Wordpress | Leave a comment