CHAPTER 8

A MEDIA THEME

IN THIS CHAPTER, I show you how to build a theme that focuses on images rather than text. This site could be a portfolio that shows off your photos, videos, or art, or any site that relies heavily on images and their descriptions. An image may speak a thousand words, but when it comes to WordPress that phrase simply means you need to think a bit differently about layout and design. You have to consider other issues and concerns as well, such as how to show image information, image titles, and so on when browsing a media-focused site.

In the following sections, I show you how to build a portfolio theme.

BUILDING SITES FOR IMAGES AND VIDEO

Text isn't always the primary type of content on the site you're building. You may also want to showcase your photographs or videos. You can use just about any theme for this, of course, but if you want to display a large, pretty image (see Figure 8-1), the ideal column width for text just won't do.

In short, sometimes you're not building for text, you're building for attachments.

Attachments are the kinds of files you typically add to your post and often these files are images. The main template file for displaying attachments, when they're not just sitting in a post, is attachment.php.

Figure 8-1: This is what you're after, a display focused on image content

image

PLANNING YOUR PORTFOLIO SITE

The theme I build in this chapter ...

Get SMASHING: WordPress Themes: MAKING WORDPRESS BEAUTIFUL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.