Create your own complete website or blog from scratch with WordPress Learn everything you need for creating your own fea
526 27 33MB
English Pages 326 Year 2011
WordPress 3 Complete Copyright © 2011 Packt Publishing
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 embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2010
Production Reference: 1180111
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849514-10-1 www.packtpub.com
Cover Image by Charwak A ([email protected])
Table of Contents Preface Chapter 1: Introduction to WordPress What is WordPress? Use it for a blog or a website Blog: Definition and common terms Common terms
1 7
7 8 8
8
Why choose WordPress? A long time in refining Active in development Large community of contributors Amazingly extendable Detailed feature list New feature list since 2.7
10 10 10 10 10 11 11
Online WordPress resources WordPress news The Codex Support from other users Theme and plugin directories WordPress.com Summary
13 13 14 15 15 15 16
Learning more
Chapter 2: Getting Started
Where to build your WordPress website Using WordPress.com Installing WordPress manually
Preparing the environment Downloading WordPress Upgrading from an earlier version of WordPress Uploading the files
13
17
17 19 22
22 23 24 25
Table of Contents Installing WordPress Learning more
27 32
The WP Admin panel Changing general blog information Your first post Your first comment Retrieving a lost password Summary
Chapter 3: Creating Blog Content WP Admin conventions Lists of items Posting on your blog Adding a simple post Common post options
Categories and tags Images in your posts Using the Visual editor versus the HTML editor Drafts, timestamps, and managing posts
32 35 36 39 41 41
43
43 43 45 45 48
49 51 57 58
Advanced post options
60
Additional writing options
66
Excerpt and the MORE tag Trackbacks Discussion Custom Fields Protecting content Pretty permalinks
60 61 62 63 64 65
Press This Posting via e-mail
Discussion on your blog—comments Adding a comment Discussion settings
Submission, notification, and moderation settings When to moderate or blacklist a comment Avatar display settings
66 67
68 68 70
70 72 73
Moderating comments How to eliminate comment spam
74 76
Adding and managing categories Summary
80 81
Getting a WordPress.com API key Activating Akismet
77 78
Chapter 4: Pages, Plugins, Image Galleries Menus, and More Pages Adding a page Managing pages
[ ii ]
83
83 84 88
Table of Contents
Menus Adding a Menu Displaying a Menu Widgets Links Adding a new link Displaying links Managing links and categories Media library Adding plugins Finding your plugin Installing and activating the plugin
88 89 92 93 94 96 97 99 100 102 103 103
Configuring and/or implementing—if necessary Adding an image gallery Choosing a post or page Uploading images Using a lightbox plugin Making your website mobile-friendly Summary
107 108 109 110 114 116 118
Auto-installation Download, (unzip?), upload
104 105
Chapter 5: Choosing and Installing Themes
119
Chapter 6: Developing Your Own Theme
133
Finding themes WordPress Theme Directory Finding more themes Some theme basics What makes a theme? Factors to consider when choosing a theme Installing and changing themes Adding a theme within the WP Admin Downloading, extracting, uploading Summary
Setting up your design Designing your theme to be WordPress-friendly Converting your design to code Examining the HTML structure Examining the CSS
Converting your build into a theme Creating the theme folder [ iii ]
120 120 123 123 124 124 125 125 129 131 134 134 136
137 140
146 146
Table of Contents
Adding WordPress content
151
The tag The header and footer The sidebar
151 152 155
Main column—the loop Creating templates within your theme Understanding the WordPress theme Breaking it up
157 162 162 163
Archive template Single template Page template Generated classes for body and post Other WordPress templates Creating and using a custom template Making your theme widget-friendly Making sure your sidebar is one big