O'Reilly logo

Smashing WordPress: Beyond the Blog, 4th Edition by Thord Hedengren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 11: DESIGN TRICKERY

THIS CHAPTER IS all about making your WordPress theme more interesting and giving it that extra functionality that makes it pop. Some of the techniques covered here are directly tied to WordPress and the kind of data you can get out of it, whereas others are adaptations of other techniques and solutions that can come in handy for your projects. This chapter shows you a variety of cool tricks: how to use tag-based design, make the menu do your bidding, include both style sheets and JavaScript libraries the proper way, make your 404s help lost visitors, and work with ads within the loop.

In other words, get ready for some WordPress design trickery.

ADDING MORE CONTROL OVER YOUR POSTS

WordPress offers various methods for adding more control over your posts. This section covers three such methods: tag-based design, custom fields, and adding your own taxonomies. I won ’t go over post formats again here, as those are covered in Chapter 6, “Advanced Theme Usage.” Using post formats, though, is a great way to get more control of your posts.

TAG-BASED DESIGN

The most common setup for a WordPress site revolves around categories and Pages. The former gives individual control of post listings and can be queried by conditional tags such as in_category(), which means that you can make all categories behave differently. This in turn means that a category archive can easily become a section on a site in a most natural way, and posts belonging to that category can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required