Book Image

WordPress 2.8 Themes Cookbook

By : Nick Ohrn, Lee Jordan
Book Image

WordPress 2.8 Themes Cookbook

By: Nick Ohrn, Lee Jordan

Overview of this book

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.
Table of Contents (17 chapters)
WordPress 2.8 Themes Cookbook
Credits
About the Authors
About the Reviewers
Preface

Preface

In the last few years, WordPress has exploded in popularity. What started as simple blogging software has become an amazingly-capable content management system. As the capabilities of the software have grown, so have the unique and novel ways in which WordPress data is displayed.

Nowadays, developers and designers utilize the WordPress theme system to build everything from simple blogs to fully-fledged news sites. You can display different content in unique ways, highlight your most important posts and pages, and engage your users by allowing them to comment on and share your content, quickly and easily.

In short, WordPress makes it easy for people to show the world what they have to offer. Theming WordPress is easy, and template files are readily-modifiable by users of any skill level. However, if you’re willing to put in the time, you will find a powerful system hidden by this simplicity that allows you to build almost anything you want. This book will teach you how to use that power to build robust and high-quality themes that take full advantage of WordPress and the WordPress ecosystem.

What this book covers

Chapter 1, WordPress Theme Basics gets you started with developing WordPress themes teaching you about the documentation and finding, creating and installing themes.

Chapter 2, Creating Navigation shows you how to implement a variety of techniques that allow your users to navigate around your site.

Chapter 3, The Loop teaches you about The Loop, the main building block of WordPress. It shows you how to display your content in unique and interesting ways, and shows you how to change the data that is fetched and presented.

Chapter 4, Template Tags shows you how to display the content that the user enters in the administrative back-end. It teaches you to use unique WordPress functions to show titles, content, and other post data.

Chapter 5, Comments shows you how to start the conversation on your blog by allowing users to view and post comments. It teaches you to modify how the comments are shown and the information shown for each comment.

Chapter 6, Sidebars covers how to display secondary content on your blog by using WordPress’ fabulous widget and sidebar system.

Chapter 7, Custom Page Templates shows you unique content and unique needs for displaying it. It teaches you how to use the powerful template system to make WordPress display the content that you want and the way you want it.

Chapter 8, Integrating Media discusses multimedia types, such as audio and video, which are now commonplace on blogs. It teaches you to take control of how images and media are displayed and create custom media templates for images, audio, video, or any other file type.

Chapter 9, Showing Author Information introduces why your site’s authors are important. It teaches you how to display author bios, latest posts, and custom data.

Chapter 10, Adding JavaScript Effects shows you how to make your theme interactive and easy to use, by adding small pieces of JavaScript functionality.

Chapter 11, Advanced WordPress Themes covers how to take your theme to the next level, by adding theme options, creating multiple color schemes, and packaging and uploading your theme to the WordPress.org theme repository.

Chapter 12, Layout shows you how to extend your theme layout options through global toolbar navigation, centered theme design, tabbed navigation, drag-and-droppable components, and added accessibility through the use of skip navigation links.

What you need for this book

You need to have the following:

  • PHP, Apache and MySQL (MAMP or WAMP for local development)

  • WordPress (latest release)

Who this book is for

This book is intended for people interested in working with WordPress themes. Some experience with PHP and HTML is assumed, but no prior knowledge of the way in which WordPress works is needed. Users with a background in WordPress themes will still be able to learn from the more advanced recipes in this book.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Locate the title tag and remove whatever value is contained within it".

A block of code is set as follows:

<div class="notice-snippet">
Thanks for visiting my site!
</div>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<?php get_sidebar(); ?>
<?php get_footer(); ?>

New terms and important words are shown in bold. Words that you see on the screen, in menus, or dialog boxes for example, appear in the text like this: "If you don’t wish to preview your new theme, you can click on the Activate link directly".

Note

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to, and mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note via the SUGGEST A TITLE form on www.packtpub.com or e-mail.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files emailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve the subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately, so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.