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

Branded Quiz Games

Date: 9th June 2009 at 12:23 pm | Filed under: flash, portfolio | Author: Sam Burdge | Tags: , , , ,

I have developed a quiz game engine based on this original multi choice quiz by animike. The improvements I made to the original flash file are:

  1. Removed the need for an external XML file, which makes it easier to distribute virally as a stand-alone file.
  2. Added the ability to add infinite arrays of questions, so the quiz will have a different set of questions each time you play.
  3. Added the potential to build arrays of questions based on statistical data, perfect for sports quizes.
  4. Added the potential to plug the game into various scoreboard and in-game advertising APIs such as MochiAds.
  5. Added brandable features such as a 'More Games' link and a preloader screen.

To test the quiz engine I released the first version of my football quiz, with 12 questions drawing from an array of 120 possible questions. It got mixed reviews on newgrounds.com, but seemed to do reasonably well on football / sports specific games sites thereafter. You can try out the first version of the quiz game here: Football Quiz

More recently I have released the first sponsored / branded version of the quiz called Premiership Football Quiz, which is sponsored by one of the UK's leading football websites - FootballFanCast.com. I have plans to work with the FootballFanCast team to develop other football quiz games, relating to specific teams, competitions, etc.

I am also hoping to branch out now into quizes relating to other sports, and to other subjects entirely, such as Pop Music, Movies, TV, Celebrities, Arcade games, World Geography, etc.

If you need a quiz game for your site, or wish to distribute a branded quiz game across a range of games sites please feel free to get in touch. I can quote on a per quiz basis, prices will depend on the level of branding, the number of questions, whether the questions are provided, whether you want me to distribute, etc. So there is no fixed price as such.

1 Response to “Branded Quiz Games”

  • Comment by Jimmy
    Date: September 19th, 2009 at 8:06 pm

    I use latest wordpress what do I do wrong? I get each column one row lower, whatever I do it still does this. Is it a bug with newest Wordpress? Ive followed everything step by step.

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

Privacy Policy

Date: 14th March 2009 at 11:30 am | Filed under: blog | Author: Sam Burdge

Privacy Policy for www.samburdge.co.uk

If you require any more information or have any questions about our privacy policy, please feel free to contact us by email at

At www.samburdge.co.uk, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information is received and collected by www.samburdge.co.uk and how it is used.

Log Files
Like many other Web sites, www.samburdge.co.uk makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.

Cookies and Web Beacons
www.samburdge.co.uk does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser.

Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include Google Adsense, .

These third-party ad servers or ad networks use technology to the advertisements and links that appear on www.samburdge.co.uk send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.

www.samburdge.co.uk has no access to or control over these cookies that are used by third-party advertisers.

You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. www.samburdge.co.uk's privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.

If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites.

Leave a Comment

Bespoke theming for WordPress Arcade sites

Date: 12th March 2009 at 7:00 pm | Filed under: blog, portfolio, themes | Author: Sam Burdge | Tags: , , , , , , , , ,

loopy1loopy2loopy4loopy3

Screenshots from the new Loopy Pursuits Arcade Site.

I have recently entered the world of Arade Website webmastering and, being the WordPress geek I clearly am, have chosen WP as the management sytem to drive my arcade sites. I have developed two new plugins WP Games Embed (released) and WP Mochi (so far unreleased) and launched my first arcade site Zap Gamez.

In the past I have had a fair few jobs designing custom / bespoke themes for WordPress blogs and for sites that use WP more as a CMS. These jobs are where most of my plugins originate from, adding custom features to sites when no existing plugin is available to achieve the same functionality.

My most recent custom theme is for the arcade site Loopy Pursuits, for which the games content is also driven by my two plugins WP Games Embed & WP Mochi. The theme is incredibly simple - no sidebar or nav bar as such, 3 basic layouts - Home page, Category/Tag/Search results page & single page view where the game itself is displayed. Apart from the formatting of the comments there is nothing about the theme which suggests it is wordpress. No 'recent posts','blogroll' or 'tag cloud' or any other content that could be associated with standard WP blog design.

The theme incorporates google advertising interspersed with the content. My approach to google advertising with arcade sites is to use predominantly image ads as gaming is very visual, and image ads seem to sit better within a very image based site layout. I also use the standard approach of identifying key placements for ads, sometimes referred to as 'Hot Spots', which are normally adjacent to key areas of the page, such as navigation, main content (i.e. the game), etc.

During the development of Loopy Pursuits the WP Mochi Plugin has come a lot closer to releaseability. It still lacks an options page which it would definitely need, but it now incorporates the Mochi Leaderboard (score board) using the Mochi Publisher Bridge, it also now has the ability to add entire directories of games automatically too!

If you are interested in getting a custom design for your WordPress blog, or if you want an arcade website set up, or if you are trying to do something different / unusual with WordPress please feel free to get in touch. I would be happy to provide a quote for any such jobs. I have been working with WordPress since version 1.2 and have set up many WP blogs in that time, I have never used a theme by someone else, custom built is the only way for me!

4 Responses to “Bespoke theming for WordPress Arcade sites”

  • Comment by العاب
    Date: April 4th, 2009 at 11:16 am

    look at my site
    its an arcade power by wordpress

  • Comment by GameGag
    Date: June 8th, 2009 at 11:18 pm

    Wow what a great looking theams, please keep up your innovative touch.

  • Comment by EnjoySilk
    Date: September 18th, 2009 at 1:22 pm

    It’s so beautiful theme!

  • Comment by Frank
    Date: January 9th, 2010 at 2:13 am

    Great theme. My site looks great with this. Thanks

Leave a Comment