Xem mẫu

  1. Programmer to Programmer™ Get more out of WROX.com Interact Chapters on Demand Take an active role online by participating in Purchase individual book chapters in pdf our P2P forums format Wrox Online Library Join the Community Hundreds of our books are available online Sign up for our free monthly newsletter at through Books24x7.com newsletter.wrox.com Wrox Blox Browse Download short informational pieces and Ready for more Wrox? We have books and code to keep you up to date and out of e-books available on .NET, SQL Server, Java, trouble! XML, Visual Basic, C#/ C++, and much more! Contact Us. We always like to get feedback from our readers. Have a book idea? Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
  2. W ordPress® 24 - Hour Trainer Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii Part I: Before You Start 1 Chapter 1: Thinking Like WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 2: Planning Your Site for WordPress. . . . . . . . . . . . . . . . . . . . . . . . . . 9 Part II: Firing Up WordPress 15 Chapter 3: Installing WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Chapter 4: Admin Area Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Chapter 5: Basic Admin Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Part III: Working with Written Content 39 Chapter 6: Adding a New Post — Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Chapter 7: Working with the Text Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Chapter 8: Laying Out Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Chapter 9: Advanced Post Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Chapter 10: Adding a New Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Part IV: Working with Media Content 81 Chapter 11: The Basics of Handling Media Files . . . . . . . . . . . . . . . . . . . . . . 83 Chapter 12: The Upload/Insert Window Tabs . . . . . . . . . . . . . . . . . . . . . . . . 89 Chapter 13: Image Options in Detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Chapter 14: Editing and Laying Out Images . . . . . . . . . . . . . . . . . . . . . . . . 105 Chapter 15: Working with Image Galleries . . . . . . . . . . . . . . . . . . . . . . . . . 117 Chapter 16: Adding Video and Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Chapter 17: Adding Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Part V: Managing Your Content 141 Chapter 18: Managing Posts and Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Chapter 19: Managing Media Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Chapter 20: Managing Post Categories and Tags . . . . . . . . . . . . . . . . . . . . 157 Chapter 21: Managing Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Continues
  3. Part VI: Making Your Site Social 169 Chapter 22: Linking to Other Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Chapter 23: Managing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Chapter 24: Connecting to Content on Other Sites . . . . . . . . . . . . . . . . . . . 187 Chapter 25: Helping Others Connect to Your Site . . . . . . . . . . . . . . . . . . . . 195 Chapter 26: Having Multiple Site Users . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Part VII: Customizing the Look of Your Site 207 Chapter 27: Customizing Your Header Content . . . . . . . . . . . . . . . . . . . . . . 209 Chapter 28: Customizing the Look of Posts . . . . . . . . . . . . . . . . . . . . . . . . 217 Chapter 29: Customizing Design and Layout . . . . . . . . . . . . . . . . . . . . . . . . 223 Part VIII: Becoming Search Engine Friendly 231 Chapter 30: Optimizing Your Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Chapter 31: Optimizing Your Site as a Whole . . . . . . . . . . . . . . . . . . . . . . . 239 Part IX: Housekeeping Chores 243 Chapter 32: How Is Your Site Doing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 Chapter 33: Keeping Up to Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Chapter 34: Backing Up Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Part X: Extending WordPress 261 Chapter 35: Installing and Activating Plugins . . . . . . . . . . . . . . . . . . . . . . . 263 Chapter 36: Example Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 Chapter 37: Ten Other Common Uses for Plugins . . . . . . . . . . . . . . . . . . . . 277 Chapter 38: Extending WordPress Even Further . . . . . . . . . . . . . . . . . . . . . 283 Appendix A: Troubleshooting WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Appendix B: Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 Appendix C: What’s on the DVD? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
  4. WordPress® 24-Hour Trainer
  5. WordPress® 24-Hour Trainer George Plumley
  6. Disclaimer: This eBook does not include ancillary media that was packaged with the printed version of the book. WordPress® 24-Hour Trainer Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana ISBN: 978-0-470-55458-6 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war- ranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disap- peared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2009937281 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. WordPress is a regis- tered trademark of Automattic, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book.
  7. This book is dedicated to my family: to my wife Kim and daughters Grace and Ella (thanks for being so patient the whole summer of 2009), and to my parents, Adelaide and Stan and my sister Patricia.
  8. Credits Executive Editor Vice President and Executive Group Publisher Carol Long Richard Swadley Project Editor Vice President and Executive Publisher Ed Connor Barry Pruett Technical Editor Associate Publisher Mike Little Jim Minatel Production Editor Project Coordinator, Cover Daniel Scribner Lynsey Stanford Copy Editor Compositor Kim Cofer James D. Kramer, Happenstance Type-O-Rama Editorial Director Proofreader Robyn B. Siesky Nancy C. Hanger, Windhaven Editorial Manager Indexer Mary Beth Wakefield Robert Swanson Marketing Manager Cover Image David Mayhew © istockphoto/Daft_Lion_Studio Production Manager Tim Tate
  9. About the Author George Plumley is a web developer living on Vancouver Island, Canada. After doing graduate work in philosophy at York University, Washington University in St. Louis, and Rutgers he went on to web development in 1993. He’s been working with various content management systems ever since, and then in 2006 discovered the joys of WordPress. He also runs the WordPress help site www.seehowtwo.com.
  10. Acknowledgments I want to thank Carol Long for sending the tweet that got this all started and for being a great Acquisitions Editor/hockey mom through the entire process; the whole Wiley team, in particular the editorial staff headed by Ed Connor, Kim Cofer who made sure my that’s and which’s were right way round and my voice was active, and Mike Little for his indispensable technical editing; Doris Michaels for pointing me to my wonderful agent, Carole Jelen, who’s been so supportive; friends like Karen Hollowell who got me addicted to 3x5 note cards and was my Canadian/American cultural attaché, Ann Douglas for running the mother of all author support lines, Peggy Richardson for her insights into the art of writing books and for doing some research, and Angela Crocker for all her sup- port; the programmers who make WordPress possible, and the WordPress community, from whom I’ve learned and continue to learn so much; and fi nally I want to thank all my clients over the years who, by asking great questions, have helped me learn to explain things more clearly.
  11. Contents Introduction xxiii Part I: Before You Start 1 Lesson 1: Thinking Like WordPress 3 Dynamic vs. Static Websites 3 Content Management Systems 4 WordPress as a CMS 4 How WordPress Assembles Pages 5 Why Separate Is Good 6 How WordPress Manages Content 6 Try It 8 Lesson 2: Planning Your Site for WordPress 9 How Content Will Be Entered 9 How Categories Will Be Organized 11 How the Site Should Look 12 Site Layout 13 Site Design 13 Try It 14 Part II: Firing Up WordPress 15 Lesson 3: Installing WordPress 17 Uploading the WordPress Files 18 Setting Up Your Database 20 Doing the Installation 21 Try It 23 Lesson 4: Admin Area Overview 25 Logging In 25 The Dashboard 27 Customizing Admin Screens 28
  12. Contents Getting Around the Admin Area 29 Try It 31 Lesson Requirements 31 Step-by-Step 31 Lesson 5: Basic Admin Settings 33 Settings to Get You Started 33 Tagline 34 WordPress Address (URL) 35 Blog Address (URL) 35 E-mail Address 35 Timezone 35 Setting Your Personal Profile 35 Try It 37 Lesson Requirements 37 Step-by-Step 37 Part III: Working with Written Content 39 Lesson 6: Adding a New Post — Overview 41 Anatomy of a New Post 41 Writing a Post 43 The Button Bar 43 What You See Isn’t Quite What You Get 44 Working with Text 44 Categories and Tags 46 Categories 46 Tags 47 Publishing a Post 48 Status 49 Visibility 50 Publish 50 Try It 51 Lesson Requirements 51 Step-by-Step 51 Lesson 7: Working with the Text Editor 53 Anatomy of the Text Editor 53 Sizing the Text Editor 55 xii
  13. Contents Styling Text 57 Underlining 57 Coloring Text 58 The Formatting Menu 58 Working with Text Links 58 Creating E-Mail Links 60 Editing Links 60 Removing Links 60 Importing Text 61 Try It 62 Lesson Requirements 62 Step-by-Step 62 Lesson 8: Laying Out Text 63 Styling Paragraphs 63 Aligning 63 Blockquotes 64 Indenting 66 Creating Lists 67 Beginning a New List 67 Working with Existing Text and Lists 68 Tips for Laying Out Posts 68 Making Use of Headings 69 Try It 69 Lesson Requirements 70 Step-by-Step 70 Lesson 9: Advanced Post Options 71 Advanced Options Overview 71 Excerpts and the More Button 72 Discussion and Comments 73 Handling Revisions 73 Try It 76 Lesson Requirements 76 Step-by-Step 76 Lesson 10: Adding a New Page 77 Pages vs. Posts 77 The Add Page Options 78 xiii
  14. Contents Creating Sub-Pages 79 Try It 80 Lesson Requirements 80 Step-by-Step 80 Part IV: Working with Media Content 81 Lesson 11: The Basics of Handling Media Files 83 The Media Library vs. Galleries 83 The Upload/Insert Menu 85 Inserting an Image into a Post 85 Try It 88 Lesson Requirements 88 Step-by-Step 88 Lesson 12: The Upload/Insert Window Tabs 89 The From Computer Tab 89 The From URL Tab 91 The Gallery Tab 92 The Media Library Tab 93 Try It 95 Lesson Requirements 95 Step-by-Step 95 Lesson 13: Image Options in Detail 97 Titles, Captions, and Descriptions 97 Title 98 Caption 98 Description 99 Linking Images 99 Choosing an Alignment 100 Choosing a Size 100 Insert vs. Save 102 Insert Into Post 102 Save All Changes 102 Try It 103 Lesson Requirements 103 Step-by-Step 103 xiv
  15. Contents Lesson 14: Editing and Laying Out Images 105 Align and Resize — An Overview 105 The Popup Image Editor 108 Moving and Resizing in the Text Editor 110 More Complex Image Layouts 112 Updating an Image 114 Try It 115 Lesson Requirements 115 Step-by-Step 115 Lesson 15: Working with Image Galleries 117 Creating an Image Gallery in a Post 117 Link Thumbnails To 118 Order Images By 119 Order 119 Gallery Columns 119 Adding and Removing Images from a Gallery 121 Changing the Order or Size of Gallery Images 121 Using Galleries from Other Posts 123 Try It 124 Lesson Requirements 124 Step-by-Step 124 Lesson 16: Adding Video and Audio 127 Uploading/Inserting Video 127 The Embed Media Button 128 Type 129 File/URL 129 Dimensions 130 Final Notes About Embedding Video 131 Adding Audio 132 Type 132 Dimensions 132 Try It 133 Lesson Requirements 133 Step-by-Step 133 xv
  16. Contents Lesson 17: Adding Documents 135 Uploading and Inserting a Document 135 What Types of Documents to Upload 136 Updating a Document 137 Try It 138 Lesson Requirements 138 Step-by-Step 138 Part V: Managing Your Content 141 Lesson 18: Managing Posts and Pages 143 Finding Posts and Pages 143 Finding Posts 143 Finding Pages 145 Renaming, Rescheduling, and More with Quick Edit 145 Using Bulk Edit 146 Bulk-Editing Posts 146 Bulk-Editing Pages 147 Changing Your Homepage 148 More Admin Settings for Posts and Pages 150 Try It 150 Lesson Requirements 150 Step-by-Step 150 Lesson 19: Managing Media Files 151 Finding Files in the Media Library 151 Editing and Deleting Media Files 153 Admin Settings for Media 154 Try It 155 Lesson Requirements 155 Step-by-Step 155 Lesson 20: Managing Post Categories and Tags 157 Managing Categories 157 Adding Categories 157 Editing, Moving, or Deleting Categories 158 Managing the Default Category 160 Managing Tags 160 xvi
  17. Contents Converting Categories and Tags 161 Try It 162 Lesson Requirements 162 Step-by-Step 162 Lesson 21: Managing Widgets 165 What Are Widgets? 165 The Widgets Screen 166 Activating and Editing Widgets 166 Moving or Removing Widgets 167 Try It 168 Lesson Requirements 168 Step-by-Step 168 Part VI: Making Your Site Social 169 Lesson 22: Linking to Other Sites 171 Managing Links 171 Managing Link Categories 174 Displaying Links 175 Sidebar Links 175 Link Categories in the Body of Posts 176 The Links Page 176 Try It 176 Lesson Requirements 176 Step-by-Step 176 Lesson 23: Managing Comments 179 Allow Comments or Not? 179 Admin Settings for Commenting 179 Display Order of Comments 181 Threaded Comments 181 Finding Comments 182 Approving, Editing, or Deleting Comments 183 Dealing with Spam Comments 184 Try It 185 Lesson Requirements 185 Step-by-Step 185 xvii
  18. Contents Lesson 24: Connecting to Content on Other Sites 187 Connecting to Your Social Media Accounts 187 Adding Content Feeds from Other Sites 189 JavaScript Feeds 190 RSS Feeds 190 Try It 192 Lesson Requirements 192 Step-by-Step 192 Lesson 25: Helping Others Connect to Your Site 195 RSS Feeds of Your Content 195 Setting Pingbacks and Trackbacks 196 Setting Permalinks 197 Try It 200 Lesson Requirements 200 Step-by-Step 200 Lesson 26: Having Multiple Site Users 201 User Roles and Their Capabilities 201 Adding a User 202 Changing a User’s Capabilities 204 Users and Security 205 Try It 206 Lesson Requirements 206 Step-by-Step 206 Part VII: Customizing the Look of Your Site 207 Lesson 27: Customizing Your Header Content 209 Built-in Header Customization 209 Using the Theme Editor 210 Adding a Logo 211 Logo Plus Existing Title Text 211 Replacing the Title Text 214 Try It 215 Lesson Requirements 215 Step-by-Step 215 xviii
nguon tai.lieu . vn