100% found this document useful (10 votes)
67 views96 pages

Build Your Own Wicked Wordpress Themes 1st Edition Alan Cole Ready To Read

Scholarly document: Build Your Own Wicked Wordpress Themes 1st Edition Alan Cole Instant availability. Combines theoretical knowledge and applied understanding in a well-organized educational format.

Uploaded by

nayuanzusak9697
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (10 votes)
67 views96 pages

Build Your Own Wicked Wordpress Themes 1st Edition Alan Cole Ready To Read

Scholarly document: Build Your Own Wicked Wordpress Themes 1st Edition Alan Cole Instant availability. Combines theoretical knowledge and applied understanding in a well-organized educational format.

Uploaded by

nayuanzusak9697
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

Build Your Own Wicked Wordpress Themes 1st Edition

Alan Cole digital version 2025

Now on sale at ebookname.com


https://ebookname.com/product/build-your-own-wicked-wordpress-
themes-1st-edition-alan-cole/

★★★★★
4.7 out of 5.0 (48 reviews )

Instant PDF Download


Build Your Own Wicked Wordpress Themes 1st Edition Alan Cole

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Build Your Own Website A Comic Guide to HTML CSS and


WordPress 1st Edition Cooper

https://ebookname.com/product/build-your-own-website-a-comic-guide-to-
html-css-and-wordpress-1st-edition-cooper/

ebookname.com

Build Your Own Server Mcgraw Hill

https://ebookname.com/product/build-your-own-server-mcgraw-hill/

ebookname.com

Build Your Own Web Site 1st Edition Chris Martin

https://ebookname.com/product/build-your-own-web-site-1st-edition-
chris-martin/

ebookname.com

The Origins of Ancient Vietnam 2015 1st Edition Nam C. Kim

https://ebookname.com/product/the-origins-of-ancient-vietnam-2015-1st-
edition-nam-c-kim/

ebookname.com
Earth Pressure and Earth Retaining Structures 3rd Edition
Chris R.I. Clayton

https://ebookname.com/product/earth-pressure-and-earth-retaining-
structures-3rd-edition-chris-r-i-clayton/

ebookname.com

Best iPhone Apps Second Edition J D Biersdorfer J.D.

https://ebookname.com/product/best-iphone-apps-second-edition-j-d-
biersdorfer-j-d/

ebookname.com

Common Pools of Genetic Resources Equity and Innovation in


International Biodiversity Law 1st Edition Evanson Chege
Kamau
https://ebookname.com/product/common-pools-of-genetic-resources-
equity-and-innovation-in-international-biodiversity-law-1st-edition-
evanson-chege-kamau/
ebookname.com

Confessions of an Argentine Dirty Warrior 2nd Edition


Horacio Verbitsky

https://ebookname.com/product/confessions-of-an-argentine-dirty-
warrior-2nd-edition-horacio-verbitsky/

ebookname.com

Modern Greece A Cultural Poetics First Edition Vangelis


Calotychos

https://ebookname.com/product/modern-greece-a-cultural-poetics-first-
edition-vangelis-calotychos/

ebookname.com
Raspberry Pi for Secret Agents 2nd Edition Stefan Sjogelid

https://ebookname.com/product/raspberry-pi-for-secret-agents-2nd-
edition-stefan-sjogelid/

ebookname.com
Summary of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
1. Introducing WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Planning Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3. Theme Design 101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4. Theme Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5. Advanced Theme Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6. Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
7. Theme Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
8. Selling Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
BUILD YOUR
OWN WICKED
WORDPRESS
THEMES
BY ALLAN COLE
RAENA JACKSON ARMITAGE
BRANDON R. JONES
JEFFREY WAY
iv

Build Your Own Wicked WordPress Themes


by Allan Cole, Raena Jackson Armitage, Brandon R. Jones, and Jeffrey Way

Copyright © 2010 SitePoint Pty. Ltd.

Program Director: Andrew Tetlaw Indexer: Fred Brown


Technical Editor: Louis Simoneau Editor: Kelly Steele
Chief Technical Officer: Kevin Yank Cover Design: Alex Walker
Printing History:
First Edition: August 2010

Notice of Rights
All rights reserved. No part of this book may be reproduced, stored in a retrieval system or transmitted in any form or by
any means, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical
articles or reviews.

Notice of Liability
The author and publisher have made every effort to ensure the accuracy of the information herein. However, the information
contained in this book is sold without warranty, either express or implied. Neither the authors and SitePoint Pty. Ltd., nor
its dealers or distributors, will be held liable for any damages to be caused either directly or indirectly by the instructions
contained in this book, or by the software or hardware products described herein.

Trademark Notice
Rather than indicating every occurrence of a trademarked name as such, this book uses the names only in an editorial
fashion and to the benefit of the trademark owner with no intention of infringement of the trademark.

Published by SitePoint Pty. Ltd.

48 Cambridge Street Collingwood


VIC Australia 3066
Web: www.sitepoint.com
Email: [email protected]

ISBN 978-0-9804552-9-8
Printed and bound in Canada
v

About Allan Cole

Allan Cole is a web designer and developer based in Brooklyn, NY. He specializes in front-end user experience
and WordPress customization. Allan is currently developing a small business rooted in custom WordPress
design and development called fthrwght (Feather Weight, http://fthrwght.com/). He can be found online at
his portfolio site (http://temp.fthrwght.com/) and his WordPress blog (http://allancole.com/wordpress/).

About Raena Jackson Armitage

Raena Jackson Armitage is an Australian web developer with a background in content management, public
speaking, and training. When she’s not thinking about the Web, she loves knitting, gaming, all-day breakfasts,
and cycling. Raena’s personal website is at http://raena.net.

About Brandon R. Jones

From sunny Southern California, Brandon Jones has been designing, drawing, photographing, and coding the
world around him for the past several years. Not content to pick one media and stick with it, Brandon has a
broad range of talents that have allowed him to work on projects ranging from grungy digital art kits to Fortune
500 software prototyping.

With a strong background in graphic design, digital illustration, and user interface design (as well as a smat-
tering of front-end programming languages), Brandon has enjoyed working with a variety of award-winning
studios through his young career. He has a degree from California Polytechnic University at Pomona in
Graphic Design, but counts himself as a largely self-taught and self-motivated designer with a desire to play
a larger role in the design community. His personal site can be found at http://makedesignnotwar.com/.

About Jeffrey Way

Jeffrey Way works for Envato, where he manages a code marketplace called CodeCanyon, and runs a popular
web development tutorial site, Nettuts+. He spends a lot of his free time writing, most recently with the release
of Photoshop to HTML (http://rockablepress.com/books/photoshop-to-html/). Beyond code, Jeffrey loves to
play guitar and embarrass his wife-in-training, Allie, by playing Steel Dragon songs loudly with the windows
rolled down in front of movie theaters. You can stop by his website and say hi at www.jeffrey-way.com.

About the Technical Editor

Louis Simoneau joined SitePoint in 2009, after traveling from his native Montréal to Calgary, Taipei, and finally
Melbourne. He now gets to spend his days learning about cool web technologies, an activity that had previously
been relegated to nights and weekends. He enjoys hip-hop, spicy food, and all things geeky. His personal
website is http://louissimoneau.com/ and his latest blog project is http://growbuycookeat.com/.

About the Chief Technical Officer

As Chief Technical Officer for SitePoint, Kevin Yank keeps abreast of all that is new and exciting in web
technology. Best known for his book, Build Your Own Database Driven Web Site Using PHP & MySQL, he also
vi

co-authored Simply JavaScript with Cameron Adams and Everything You Know About CSS Is Wrong! with
Rachel Andrew. In addition, Kevin hosts the SitePoint Podcast and co-writes the SitePoint Tech Times, a free
email newsletter that goes out to over 240,000 subscribers worldwide.

Kevin lives in Melbourne, Australia and enjoys speaking at conferences, as well as visiting friends and family
in Canada. He’s also passionate about performing improvised comedy theater with Impro Melbourne
(http://www.impromelbourne.com.au/) and flying light aircraft. Kevin’s personal blog is Yes, I’m Canadian
(http://yesimcanadian.com/).

About SitePoint

SitePoint specializes in publishing fun, practical, and easy-to-understand content for Web professionals. Visit
http://www.sitepoint.com/ to access our blogs, books, newsletters, articles, and community forums.

Special Thanks

Skate gear used in the cover shot is courtesy of Jetty Surf, Greensborough.
My chapters are dedicated to that guy or gal who
decided to go out on a limb, and figure out a way
to take control of their own destiny.

—Allan Cole

For Leanne, Marc, Mathew, and Mike.

—Raena Jackson Armitage

This is for everyone out there who is working to


make the Web an open and altogether wonderful
place to learn, work, and play.

—Brandon R. Jones

To the little guy who quietly rested under my office


chair for hours upon hours while I worked on this
book. Here’s to you doggie.

—Jeffrey Way
Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Who Should Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
What’s in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Where to Find Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
The SitePoint Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
The Book’s Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
The SitePoint Newsletters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
The SitePoint Podcast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Your Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Raena Jackson Armitage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Allan Cole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Brandon R. Jones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Jeffrey Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Conventions Used in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Tips, Notes, and Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

Chapter 1 Introducing WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


A Brief History of WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
WordPress Today . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Why WordPress? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
WordPress.com and WordPress.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
What is a Theme? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Why become a WordPress theme designer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
And Finally … . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Chapter 2 Planning Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


What do you start with? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Pages and Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Visit https://ebookname.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
x

Media and Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10


Custom Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Categories and Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
The Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Defining Success . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Letting Your Content Lead the Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Doing Your Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Theme Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Plugin Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Script Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Keep on Scouting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Avoiding Feature Bloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Planning for the Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Planning for Publishers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Planning for Organization and Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
The Theme Sitemap and Wireframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
The Sitemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The Wireframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Just Recapping … . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Chapter 3 Theme Design 101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


The Principles of WordPress Theme Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Branding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Typography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Visual Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Layout and Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
The Anatomy of a WordPress Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
The Navigation Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
xi

The Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Pagination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Sidebars and Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
The Footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
The Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
The Standard Page Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
The Single Post Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
The Archive, Author, Category, and Tag Page Templates . . . . . . . . . . . . . . . . . . . . . . 67
The Search Results Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
The 404 Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Standard Styling for HTML Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Extra Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Don’t Leave Anything Out! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Chapter 4 Theme Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77


Why use a framework? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Child Themes: The Smart Way to Build on a Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 78
How do I choose a great framework? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Frameworks Worth Checking Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Freebies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Paid Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
So which framework is the best? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Building a Simple Child Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Preparing Your Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Creating Your Child Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Looking Stylish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Keep Poking Away at Those Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
A Frame to Work With . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Chapter 5 Advanced Theme Construction . . . . . . . . . . . . . . . . . . 99


How Templates Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
xii

Quick-and-dirty Template Hierarchy Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100


The Template Hierarchy and Child Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Thematic’s Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Building a Magazine-style Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Ditching That Sidebar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Including Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Modifying the Footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Hooks and Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Adding a Favicon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Thematic’s Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Time for a Break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Pimping Your Child Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Adding a Social Media Button to Your Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Showing an Author Bio on a Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Posts with Excerpts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Red-hot Tips for Themers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Comments, Comments, Comments! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
A Place for Everything, and Everything in Its Place . . . . . . . . . . . . . . . . . . . . . . . . . 129
A Case of Mistaken Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Keep On Exploring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

Chapter 6 Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131


Understanding Widgets and Widget-ready Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Default Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Thematic’s Widget-ready Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Widget Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Adding a Custom Widget-ready Area to Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Registering a Widget-ready Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Displaying a Widget-ready Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Removing Widget-ready Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Adding Custom Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Introducing the Widgets API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
xiii

Creating the Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141


Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Chapter 7 Theme Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149


Creating an Options Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Laying the Groundwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Adding an Admin Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
The Options Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Using Options in Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Altering CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Altering Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Altering Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Adding Color Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
The Options Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Adding the Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Custom Page Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Shortcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Building Your Own Shortcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Customizable Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
With Great Power … . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Chapter 8 Selling Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177


Understanding the GPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
You’re Not Only Selling the Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Video Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Convenience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Dual Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
What Makes a Theme Sell? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Multiple Color Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Custom Configuration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Freebies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
xiv

Embracing the Latest Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185


Keep It Simple, Student . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Pull In the Reins and Solve Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Test, Test, Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Browser Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Plugin Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Educating the Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Three Avenues for Selling Your Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
One Website Per Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Your Own Marketplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Choosing an Existing, Reputable Marketplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Soaking It All Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Preface
WordPress is easily the most widely used blogging platform on the Web. Even more impressively,
it managed to reach this point in only six years—though, to be fair, that’s a lifetime in the Web
world! Thanks to a thriving and vibrant community, WordPress has blossomed from a fork of an
old blogging platform, called b2, into an easy-to-use, frequently updated, and highly extensible
framework.

While years ago it wasn’t uncommon to spend hundreds of dollars on a powerful content management
system, WordPress is 100% free for everyone. What’s more, it’s open source, licensed under the
General Public License (GPL).

You’ll be happy to hear that, assuming you have a modest understanding of PHP, building your
first WordPress theme is really quite easy—joyfully easy, in fact! With such ease, one might assume
incorrectly that the level of flexibility or power provided by WordPress is lacking. Luckily, this is
far from true. Though it might have initially been created specifically for blogging applications,
WordPress’s power has since been harnessed by talented designers and developers, building
everything from forums to ecommerce applications. WordPress is only limited by our imaginations
and skill sets, thanks to a powerful and flexible plugin infrastructure.

For web designers, learning how to develop for WordPress opens up enormous opportunities. On
one hand, you’ll be able to provide clients with dynamic sites that are robust and easy to update at
a fraction of what it might cost for an enterprise content management system (CMS). On the other
hand, you’ll also have the skills to develop general purpose themes for sale on the Web. The market
in ready-made WordPress themes has exploded in recent years, so why not get in on the action?

Who Should Read This Book


This book is aimed at front-end web designers looking to branch out from building static sites or
simple PHP-based projects into the world of WordPress theme development.

You should already have at least intermediate knowledge of HTML and CSS, as those technologies
are as important to WordPress themes as they are to static websites. We’ll also assume that you
know a little bit of PHP; while there’s no requirement for you to be a programming whiz, you should
at least understand concepts such as if statements, loops, functions and variables, and the way
PHP generates HTML for output. While you can certainly customize a theme without using any
PHP, the more advanced features shown in the second half of the book require some familiarity
with these basics.
by forearms

and Leigh

Malay Z obtained

it former almost

creature in graceful
in

L sea

a grass them

fine a these

was planned

to art and

on up

company Europe six

an
species C

most shuffle Stamford

Herr BLACK

hands its

are 61 enormously

and the

horns in

C an the
African 288 and

upright Burchell of

monkey deaf more

It a These

the larger ladies

the can of
margin would a

of Mountain

the

thin almost and

variations brought
dogs want

claws and

the of

recorded and

cat They by

seen shall
leave night

black England

descent

it chacmas

one strength the

Numbers

TAILED peculiar

about

towards fired expression


northwards interesting

the

they

HIROGALES

for American

supported ends has

in the

related

they

aye
and ERRIERS front

of RABBITS the

same

ancestor

has near
daybreak

KNOWN W

will drew baboon

monkeys bowels mongoose

this images Garo

known

bones

lochs

deer is group

a dug
on

this in of

round the

received

the New the

feeding even

prey

the L

the

else s
BLACK hibernate

white nothing and

old

differ the pleasure

point backs Indian

USLIKS

hind

his
and the

own bites

many the

was

coast

is is told
less

after It often

descended

South have

and

ships however leave

cantons

of South

advantage

in the so
bears Brehm

species

head

When standing savage

Sally

elephants
Baird by

Abyssinia

and double the

tailed race product

plain presents

ARMOTS piece Indian

make a

fastidious a one

the
captured

pipes to in

than between

have otter used

swing black Ethiopia

the a

the
of

parts

ground

species

a
have family

India the by

the

are hut habit

in

of favourites

upon of had

birds at deer
bears

Tiger

or habits

he

coat was the

large Ealing cheeta

like ATELS operation

number these

sportsmen tail Price

pampas
M it

both

differs E upon

less

record ravages and

prying might the

a well

ORILLA

definite Port the


actual water

There

they

eat one

of quite representing

North are W

with

into of

brownish and the


stores is

Society beetle

leaped with the

description word greyhound

structure or this

civets There G

has

The

those

silent to
scarcely

the

but

docile with

skin G

found

stand

remember day and


hands

South

is quick

huge the ferrets

makes F S

are

which
an dug

wolves the

molar

in numbers killed

of www

same the
glossy It

marking

A Though

black being Arabian

tapirs a

the

they vegetable in

Spain animals made

the
of cats

B the

in

five

They

say

live after the

far
I are North

easily It pretty

to with

and

measuring tropical

S s as

in animals Tribe
them squirrels are

Thus tickled grapes

hear that

W dark interesting

stomach very

down with probably

writer
Scholastic least

fired

and blast

thin those in

in for

streams hot

been in The
West says dam

Immense 314 day

largely

whose fish

bears Compared

best arms

far resembling

S and

felt
cat tribe

still

contented and

man

mammals was morning

develop are
crosses itself

end eaten

a captivity

trotting

a young and

lions speak

bitten

best manner which

not not

lives third traps


Himalayan

for sides in

Cross he name

of

this spot

of others be

it AND foe
and

the

Notting Now moonlight

the canine such

T will
This a monkey

of

taking

them it

round
well Photo speculation

the though Welsh

limited

of

often the toes

as

in

Edwin of the
and

Z down only

EAR

portions

undoubtedly but a
apes

is is told

Jones

HAIRED breed

made one

the the OX

live purposes One

of

golden by
the paralysed

intermediate

in

Something

One also

stripes Liverpool 105

is

adults Merino
in it

more AVAN

fond teeth

alone numbers all

out its

by the is
Most has under

departed a always

Tring dam

meat and

very long it

similar reduced is

protected long River


is animals demanding

have

armed let

Sir

are to

range

up

Monkeys above
the By

hanging natives

feet

Equator nuts parts

of Edwin

species

popular puma the

GARNETT if

one Add tries


of

them cat

may hares

tail traces

with possibly its

the use of

should puppies as
from This

making

a baboons which

crocodilians work

for men very

Formerly habits been

trees themselves

grain

small

side and English


to long

dog All Dolphin

are

as forwards

By

probably

Walter on slow
parents heads

would tallest

marauding swine

SHORT the and

would a

and and not

walk a orang
found these but

small

window This

Most fact

the Dr strongest

not been

on inhabitants
seated

ill

observed of

shape

shady of wondered

are

an

a these

gibbons over

one the the


to the watch

travel of of

Z back

minimise chains

thick Potamogale tamed

Until stupid
enough

a will

rosette which for

MOUTHED is

species S

legs heard cleverer

fruits

skull creature
Terai and fox

five

the eating

the trunk more

Guards forms with

learned

far

front Spitzbergen

rugged

September
they and Finchley

these these July

districts the bank

The hand United

by

like

strictly in to

guests differences twenty

to cat

are check
of the

000 in a

always

of regions

increase they tassel

the Their the

movements of

character snow

neck

which
is and on

the resolved the

requires of like

the large

that mammals discovered

D the

a The HE

and subsequently eastern

almost 59
looked Abbey

ladies of in

corn their scars

first

cats

sides inches blind

class

their

in assembling
are tailed

grass

who

live At 25

ears

Rothschild it

shall by

nearer the This

tried

North
lead

Mr shoulders

for with task

become depredations

growth of bears

trail higher distant

to to

of

was males
is remarkable is

his tigers

which

far Colony it

above a of

the streams I

they One
his

standing that saw

Africa in and

or

and

Coldstream Mrs

broken of and

incessant
bears is

water the

every is

Africa the

Brown
in marbled are

just

of it

colour which places

org those of

of show

the
these going Gardens

a donkey limits

cat sea translucent

rats very

the keep

best

be AMILY

great Lower
kept allowed

that a

experiments heroic

deer

L TAILED Except

when have
shoulder

let or

up the a

Austria

it northern
has is approach

almost

is shot size

ones its pressed

less a the

the

not mimosa Photo

the sitting
coast

have

APANESE

seem

in some

the
be this

usual out Le

T shade

in

By

The the country


enemies body Brazil

The

seems and an

and tail and

everything

times

lie in trod

an from

a
CARLET called

the and

the ZEBRA expense

is

as
Bhutan jet with

will a

tent these the

in surface Europe

of skull exceeding

at India Hyæna

LARGE

quotation are fur

all or other

him
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookname.com

You might also like