WordPress Attachment Page Template Code Snippets

Date: 15th November 2009 at 4:25 am | Filed under: scripts, wordpress | Author: Sam Burdge | Tags: , , , , ,

I haven't written as many WordPress tutorials as usual lately, as I have been so busy building websites and blogs, so I thought I would take the time out to share a few WordPress codes I have developed recently for attachment page templates and specifically the image attachment page template. The attachment page template is the page that displays a single image when the images link URL is set to 'Post URL'. You can set the image's link URL when inserting a single image into a post, and also when using the gallery shortcode.

The codes in this article are mostly applicable to images inserted using the gallery shortcode as they are most useful for posts or pages that have multiple image attachments. Read more about using image and file attachments.

These template codes can be added to your WordPress theme using the attachment.php and image.php files. If these template files do not exist in your theme you can create them, or WordPress will default to using single.php or index.php to show attachments by default. (See more about template hierarchy).

If you don't want to create a seperate image.php or attachment.php template you can always edit the index.php or single.php files and wrap the attachment specific codes in the is_attachment clause like so:

if(is_attachment()){
//attachment page specific code goes here
}

These php functions are loosely based on code I found in this article: Adding text links to WordPress Gallery by Michael Fields. In this article he provides code examples of how to show previous and next thumbnail links in a WP attachment page. I also made use of this previous-next keys in array function which is infinitely useful!

My first set of functions will return text links for previous image, next image and back to gallery. The functions themselves will need to be added to your theme's functions.php file before calling them in your image.php or attachment.php files. So here we go:
Read on…

Leave a Comment

New e-commerce module for Admin76 CMS

Date: 26th June 2009 at 12:16 am | Filed under: blog, development | Author: Sam Burdge | Tags: , ,

I have been working for some months now to develop an e-commerce module for Admin76,  the CMS which is currently exclusive to 76 Creative. The e-commerce module, called Cart76, utilises many of the nice features of Admin76 such as drag n drop functionality, advanced image gallery management, etc. It is now in it's final stages of development, so if you are interested in running your self-managed site on the Admin76 platform, or if you require a self-managed online store please contact 76 Creative for more info.

1 Response to “New e-commerce module for Admin76 CMS”

  • Comment by Ben
    Date: December 15th, 2009 at 5:40 am

    That’s nice topic. But I had a hard time viewing your site in IE. What could be wrong?

Leave a Comment

Video Gallery - Neil Stewart / Fella Pictures

Date: 21st April 2009 at 3:41 pm | Filed under: development, portfolio | Author: Sam Burdge | Tags: , , ,

This week I have been working on improving the 'Moving Image' section of photoneil.com. When I first built the site (designed and built by 76 Creative) the Moving Image page featured Neil's video showreel, since then video has become a more prominent aspect of his work so I have created a video gallery page for the site, allowing him to showcase a range of his video work under different categories.

As this video gallery uses seperate pages for the video list and the player itself I programmed it in PHP using the Longtail / JW Player to play the flv videos. For more information about encoding video for Flash as flv see my article: Encoding FLV

The video gallery also offers the option to download higher quality Quicktime Movies of each video. I encoded the quicktimes using the mpeg-4 codec and reducing the frame size slightly to allow for higher picture and sound quality while keeping the filesizes reasonable for a download.

Check it out: www.photoneil.com/movingimage.php

Leave a Comment

Zakeeya.com - Art & Photography blog sketchbook

Date: 2nd April 2009 at 9:20 pm | Filed under: portfolio | Author: Sam Burdge | Tags: , , , ,

zakeeya-screen

This simple, elegant blog was designed and built by 76 Creative (coded by me:¬)  for London based artist Zakeeya. It is powered by the Gallery Mangement feature of Admin 76, 76 Creative's custom Content Management System.

The Gallery Management system was originally intended for creating a series of galleries, rather than one huge one, so although being simple in appearance on the front end, the back end of this site still posed one or two challenges for me and allowed for improvements to be made to the CMS in the process.

Another thing I enjoyed about this site is doing a layout with a fluid width in CSS, most sites I have done are fixed width so it was interesting to change things up a bit.

I'm a big fan of simplistic / minimal websites where the content is the main focus.  Check it out:

www.zakeeya.com

Leave a Comment

Matthewmaran.com - Website Update

Date: 11th March 2009 at 12:39 pm | Filed under: portfolio | Author: Sam Burdge | Tags: , ,

maran-scr2maran-scr

The latest site to be powered by the new Admin76 Content Management System is www.matthewmaran.com. Matthew Maran is an award winning wildlife photographer, so his site really put the gallery management feature of Admin76 to the test.

Following the design of the original website (with a few minor changes to the layout) I implimented the Admin76 system throughout the site allowing easy management of all text and image content.

The other main addition to the site is the soundtrack. Each page plays a random background noise - birdsong, seashore, crickets etc.

Check it out: www.matthewmaran.com

Leave a Comment