WordPress 2.8 Themes Cookbook

WordPress 2.8 Themes Cookbook
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 44%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Take control of the look and feel of your WordPress site
  • Quick recipes to get started and successfully build advanced themes
  • Step-by-step instructions and useful screenshots for easy learning
  • Give a professional look to your web site with popular JavaScript libraries

Book Details

Language : English
Paperback : 312 pages [ 235mm x 191mm ]
Release Date : July 2010
ISBN : 1847198449
ISBN 13 : 9781847198440
Author(s) : Nick Ohrn, Lee Jordan
Topics and Technologies : All Books, CMS and eCommerce, Cookbooks, Content Management (CMS), Open Source, WordPress

Table of Contents

Chapter 1: WordPress Theme Basics
Chapter 2: Creating Navigation
Chapter 3: The Loop
Chapter 4: Template Tags
Chapter 5: Comments
Chapter 6: Sidebars
Chapter 7: Custom Page Templates
Chapter 8: Integrating Media
Chapter 9: Showing Author Information
Chapter 10: Adding JavaScript Effects
Chapter 11: Advanced WordPress Themes
Chapter 12: Layout
  • Chapter 1: WordPress Theme Basics
    • Introduction
    • Finding documentation on WordPress.org
    • Downloading themes from the WordPress theme repository
    • Downloading themes from third-party websites
    • Installing and activating a theme
    • Displaying the blog name
    • Getting the absolute directory path of the active theme
    • Creating a theme from scratch
    • Creating a child theme
    • Creating a theme by using a theme framework
    • Adding expected WordPress hooks
    • Including PHP files from your theme
  • Chapter 2: Creating Navigation
    • Introduction
    • Listing all of the pages that exist on a blog
    • Listing all of the categories defined for a blog
    • Listing all of the tags in use on a blog
    • Highlighting the current page in the navigation
    • Adding a search function to a theme
    • Getting the category page link from a category name
    • Displaying page links only if the destination page exists
    • Creating a category drop-down menu
    • Creating drop-downs using child pages
  • Chapter 3: The Loop
    • Introduction
    • Creating a basic Loop
    • Displaying ads after every third post
    • Removing posts in a particular category
    • Removing posts with a particular tag
    • Highlighting sticky posts
    • Creating multiple loops in a single template
    • Displaying only posts in a particular category
    • Styling every other post differently
    • Styling posts in a particular category differently
    • Showing every post in a category on a category archive page
  • Chapter 4: Template Tags
    • Introduction
    • Displaying the post title
    • Automatically limiting the number of words of content
    • Determining if the user is on a specific page
    • Determining if the user is viewing a post in a particular category
    • Displaying the post date for each post
    • Highlighting search terms in post content
    • Displaying login/logout links
    • Adding navigation through older/newer posts
    • Displaying an edit link for posts
    • Displaying custom field content
    • Displaying a post author's avatar
  • Chapter 5: Comments
    • Introduction
    • Displaying a comment form on a post
    • Displaying comments on a post
    • Displaying the latest comments on your blog
    • Highlighting the post author's comments
    • Alternating the style for comments
    • Displaying threaded comments properly
  • Chapter 6: Sidebars
    • Introduction
    • Using the Text widget for custom sidebar content
    • Including a dynamic sidebar in your theme
    • Including multiple dynamic sidebars in your theme
    • Setting the default widgets for a sidebar in your theme
    • Positioning multiple sidebars in your theme by using CSS
    • Styling the appearance of sidebars in your theme by using CSS
    • Displaying different widgets on different pages by using the Widget Logic plugin and conditional tags
    • Showing asides in the sidebar by using the Miniposts plugin
    • Adding an interactive Facebook-style wall to a sidebar by using jQuery
  • Chapter 7: Custom Page Templates
    • Introduction
    • Creating a simple page template
    • Creating an archives page template
    • Creating a taxonomy navigation template
    • Displaying author avatars and descriptions
    • Creating a table of contents page template
    • Showing your pictures from Flickr
    • Displaying a special template for a specific category
  • Chapter 8: Integrating Media
    • Introduction
    • Aligning images properly within a post
    • Styling image galleries
    • Styling image captions
    • Creating a media template
    • Creating a media template for a specific media type
    • Displaying a related image for every post
    • Creating video posts by using the Viper's Video QuickTags plug-in
  • Chapter 9: Showing Author Information
    • Introduction
    • Getting author data via an author's ID
    • Dynamically displaying the author's name and linked e-mail address
    • Listing all of the published authors on a site
    • Listing the authors who most recently published a post
    • Listing authors by the total number of comments that their posts have received
    • Adding a custom user field to display an author's Twitter link
  • Chapter 10: Adding JavaScript Effects
    • Introduction
    • Linking to your theme's JavaScript files directly
    • Adding JavaScript files to your theme programmatically
    • Adding a bundled library to your theme programmatically
    • Creating a featured post slider
    • Making sidebar widgets toggle-able
    • Adding a font size toggle
  • Chapter 11: Advanced WordPress Themes
    • Introduction
    • Adding a theme options page
    • Allowing for multiple theme color schemes
    • Changing the default Gravatar icon for your theme
    • Registering shortcodes for your theme
    • Localizing your theme
    • Displaying information based on the logged-in user's role
    • Packaging your theme for distribution
    • Uploading your theme to the WordPress.org theme repository
  • Chapter 12: Layout
    • Introduction
    • Adding a skip navigation link for usability
    • Centering your site's layout in the browser window
    • Setting up a randomly-rotating header image
    • Making theme components drag-and-drop
    • Creating a global toolbar for your theme
    • Creating tabbed navigation for your theme

Nick Ohrn

Nick Ohrn has been creating with WordPress for more than five years and has worked with some of the biggest media companies in the USA.  In his day to day work, he deals with the WordPress source, creates custom themes and plugins, and helps his clients and customers utilize WordPress to run their sites and their businesses.  Nick has a Bachelor’s of Science in Computer Science from the Rose-Hulman Institute of Technology and works full time as a web developer with an emphasis in WordPress development.  He resides in Seattle, WA and works with people and companies from around the world.

Lee Jordan

Lee Jordan is a web developer with a large collection of web technology acronyms on her resume that sound like the names of laundry detergents and cause glazed expressions in school children. She designs and maintains internal and external enterprise-level websites and web-based applications as part of a project team for a privately held technical services company. Her work includes proposing, writing, and editing web content and user guides people actually read. She began her career in 1997 as a web designer after graduating from Florida State University with a Bachelor of Fine Arts, where she swears that she missed at least one home football game while in the computer lab. Lee later convinced Seminole Community College to give her a Web Programming degree in 2003, even though her final project was a Java-based application that actually contained a usable help file. Web development topics or whatever she can think of at the time are posted on her blog at http://leejordan.net.

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

WordPress 2.8 Themes Cookbook +    OpenLayers Cookbook =
50% Off
the second eBook
Price for both: $34.95

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Enhance your page templates, optimize the use of images, and add effects to them
  • List your pages, categories, and tags on a blog and create navigation
  • Stylize your posts to make them look interesting
  • Display, format, and tweak the comment system to attract the visitors
  • Add sophistication to your dynamic web site using popular JavaScript libraries
  • Package and distribute your theme using the WordPress.org theme repository
  • Display auxiliary information about the post being displayed using dynamic sidebars
  • Empower your end users to change the contents displayed in the theme's sidebar without involving a programmer
  • Change the style of your theme depending upon image content and time

In Detail

Themes are among the most powerful features that can be used to customize a web site and give it a professional look, especially in WordPress. Using custom themes you can brand your site for a particular corporate image, ensure standards compliance, and create easily navigable layouts. But most WordPress users still continue to use default themes as developing and deploying themes that are flexible and easily maintainable is not always straightforward and lot of issues pop up during the process.

This easy-to-use step-by-step guide will help you create powerful themes for your WordPress web site, and solve your theme development problems in a quick and effective way. It enables you to take full control over your site's design and branding and make it look smarter.

WordPress is distributed with two ready-to-use themes. You can use these themes to give a common look to your website, or use the techniques described in this book to create custom themes. This book includes over 100 useful recipes to help you get started and create advanced themes. It starts with the basics of WordPress themes and creating a theme from scratch. Then, it covers how to enhance your template and add effects to get a rich look. You will learn how to manage pages, categories, and tags for your blogs, and how to make your posts look unique. You will also learn about the comment system and sidebars that will help you give a new feel to your blog and web site.

This book will help you through the most common problems encountered when developing a WordPress theme. You will get tips to enhance your design skill and eventually enhance your blog's design.

Get solutions to common WordPress theme design problems and create custom themes to make your web site look smarter


Each recipe comprises step-by-step instructions followed by the analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or you can look at the list of recipes and refer to them in no particular order. There are plenty of useful screenshots to make learning easier for you.

Who this book is for

This book is for WordPress developers who want to create powerful themes for their blogs and web sites to impress and influence visitors.

This book expects working knowledge of the WordPress platform. Knowledge of HTML and CSS would also be useful.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software