Contents

■ Contents at a Glance iii

■ About the Author xvi

■ About the Technical Reviewer xvii

■ Acknowledgments xviii

■ Introduction xix

■ Chapter 1: About WordPress 1

Why WordPress? 1

Easy to Set Up 1

Easy to Use 2

Easy to Extend 3

The Business Benefits of WordPress 4

Sites Built with WordPress 4

Personal Blogs 4

Blog Networks 6

Social Networks 8

Colleges and Universities 9

Small Businesses 10

WordPress Tour 11

Anatomy of a post 12

Summary 14

■ Chapter 2: Installing and Upgrading 15

System Requirements 15

One-click Installation 15

Installation Using the Web Interface 16

Logging In 20

Editing and Uploading wp-config.php 22

Troubleshooting 23

Installing Themes 25

Installing Plugins 28

Plugging the gaps: Essential Plugins 32

Upgrading Plugins 33

Upgrading WordPress 35

Automatic Upgrades 36

Manual Upgrades 38

Moving a WordPress Site 39

Summary 40

■ Chapter 3: Dashboard and Settings 41

The Dashboard 42

QuickPress 43

Incoming Links 43

WordPress Development Blog 44

Plugin dashboard widgets 44

Dashboard Widgets and Users 44

Settings 45

General 45

Writing 47

Reading 48

Discussion 49

Media 54

Privacy 56

Permalinks 57

Summary 59

■ Chapter 4: Working with Content 61

Posts 61

Content 63

Permalinks 70

Publish Settings 70

Categories 71

Tags 72

Featured Images 74

Excerpts 75

Comments and Trackbacks 75

Revisions 77

Custom Fields 78

Pages 78

Page Attributes: Parents, Templates, and Order 78

Posts vs. Pages: Same, but Different 82

Posts are Pages; Pages are Posts 83

Editing Posts and Pages 83

Media Files 88

Images and Galleries 88

Video 94

Audio 96

Other File Types 97

The Media Library 97

Links 98

Basic Link Attributes 98

Link Relationships: XFN™ 99

Advanced Link Attributes 101

Link Feed 101

Feeds 101

Summary 103

■ Chapter 5: Importing Content 105

Before Importing 105

Importing Blogs 105

Importing from WordPress.com 107

Importing from Blogger 110

Importing Joomla or Mambo Sites 113

Importing Other MySQL-based Sites 116

Drupal 116

Importing HTML Files 117

After Importing: Fixing What's Broken 120

Link URLs 120

Paths to Linked Files 121

Truncated or Garbled Content 122

Summary 123

■ Chapter 6: Creating a Basic Theme 125

Using Widgets 125

Using Menus 127

Creating a Menu 127

Editing Menu Items 128

Creating Multiple Menus 129

Using Header and Background Images 130

Turning HTML into a Theme 132

Header 134

Body 135

Footer 141

Stylesheet 141

Template Tags 142

Theme Files 144

Theme File Hierarchy 145

The Home Page 146

Single Posts 146

Pages 146

Custom Content Types 146

Category Archives 147

Tag Archives 147

Custom Taxonomy Archives 147

Author Archives 148

Date-Based Archives 148

Search Results 148

Error 404 (File Not Found) Page 148

Attachment Pages 149

Listing Comments 149

Including Additional Files 151

Styling Content 151

Changing Appearance Based on Context 151

Conditional Tags 152

Posts vs. Pages 153

Categories 153

Author Archives 154

Search Results 155

Creating Navigation Menus 155

Custom Navigation Tag 155

Page Lists and Page Menus 155

Category Lists 160

Theme Functions 160

Enabling Widgets 161

Enabling Menus 163

Enabling Featured Images 163

Enabling Custom Backgrounds and Headers 164

Enabling Shortcodes in Text Widgets 165

Changing Excerpt Length and Ellipsis 166

Other Uses 167

Child Themes 167

Child Theme File Hierarchy 168

Troubleshooting Themes 171

Summary 171

■ Chapter 7: Creating an Advanced Theme 173

Modifying the Loop 173

Excluding a Category from the Home Page 174

Showing Only One Category on the Home Page 175

Showing Most Recent Pages Instead of Posts 175

Looping Through All Children of a Page 176

Listing Attached Files 178

Multiple Loops 179

Resetting the Query 181

A Loop for Each Category 181

Showing the Author's Other Recent Posts 185

Accessing Post Information Outside the Loop 186

Search Engine Optimization (SEO) 186

Improving the Title Tag 186

Using Categories and Tags as Keywords 187

Using the Excerpt as a Description 188

Short Links and Canonical URLs 188

Adding Scripts and Stylesheets 189

Using JavaScript Libraries 189

Adding Your Own Scripts 190

Conditionally Adding Scripts 191

Adding Stylesheets 192

Outside the Theme Hierarchy: Database Errors and Maintenance Messages 192

Theme Options 193

Adding an Options Page 193

Registering Options 194

Creating an Options Form 195

Adding a Stylesheet to the Options Page 198

Putting it All Together 199

Theme Frameworks 201

Distributing Themes 201

Theme Checklist 201

Summary 203

■ Chapter 8: Creating Widgets 205

Basic Widgets 205

Examining the Calendar Widget 205

Creating Your Own Widget 210

More Widget Examples 217

Dashboard Widgets 218

Configuration Screens 220

Summary 223

■ Chapter 9: Creating Plugins 225

Getting started 225

Creating a Template Tag 226

Creating Template Tags with Arguments 227

Making Room for Options 228

Adding an Options Page 232

The Settings API 234

Registering Settings and Creating Defaults 234

Creating the Options Form 235

Updating Options 239

Deleting Options 240

Wrapping Up 240

Plugin Possibilities 245

The Shortcode API 246

Checking for Capabilities 248

Hooks: Filters and Actions 250

Actions 250

Filters 252

Prioritizing and Troubleshooting Actions and Filters 254

Variations on Option Pages 255

Adding Other Submenus 255

Adding a Top-level Menu Item 255

Adding a Section to an Existing Options Page 256

Publishing a Plugin 258

Readme Files and Screenshots 258

Subversion (SVN) 260

Localization and Internationalization 266

Summary 270

■ Chapter 10: Users and Roles 271

Users 271

Displaying a User's Information 273

Extending User Profiles 274

Changing Contact Fields 274

Creating More Profile Fields 275

Displaying All Users' Information 276

Roles 278

Roles in Action: Notifications, Moderation, and Workflow 279

Improving Workflow with Plugins 281

Changing, Creating, and Removing Roles 284

Modifying Roles 284

Creating Roles 285

Removing Roles 287

Managing Roles with Plugins 287

Summary 288

■ Chapter 11: Performance and Security 289

Caching 289

Setting up Super Cache 290

Caching and Mobile Stylesheets 294

Permalinks and Performance 295

Tracking Down Performance Problems 296

Securing Logins 297

Login Lockdown 298

SSL 299

Removing The Meta Generator Tag 299

File Permissions 299

Securing .htaccess and wp-config.php 300

Changing File Locations 300

Moving wp-config.php 301

Giving WordPress Its Own Subdirectory 301

Moving wp-content 302

Database Security 303

Changing the Table Prefix 303

Backing Up the Database and Files 304

Monitoring Security Problems 305

Summary 307

■ Chapter 12: Custom Content Types, Taxonomies, and Fields 309

Custom Taxonomies 309

Non-hierarchical Taxonomies 312

Hierarchical Taxonomies 315

Using Custom Taxonomies 316

Custom Content Types 321

Non-hierarchical (Post-like) Content Types 324

Hierarchical (Page-like) Content Types 327

Custom Taxonomies for Custom Content Types 328

Changing Edit Screen Columns 330

Including Custom Content Types in Your Theme 333

Feeds for Custom Content Types 335

Custom Fields in Custom Content Types 336

Creating the Custom Fields 337

Verifying and Saving User Input 340

All Together 341

Summary 346

■ Chapter 13: Setting up the Network 347

Network Requirements 347

Subdomains 347

Subfolders 348

Activating the Network 348

Configuring the Network 350

Operational Settings 351

Dashboard Settings 351

Registration Settings 352

New Site Settings 353

Upload Settings 354

Menu Settings 356

Creating Additional Network Sites 356

Network Users 357

Splogs 358

Network Plugins and Themes 359

Plugin and Theme Options 361

Upgrading the Network 361

Mapping Domains 362

BuddyPress 364

Features 364

Installation 366

Using BuddyPress 371

Summary 371

■ Appendix 1: Plugin Index 373

■ Appendix 2: Theme Functions 381

■ Appendix 3: Plugin Recipes 385

Wiki 385

Document Sharing 386

Project Management 387

Newsroom 387

Twitter Archive 388

News Clipping Archive 388

Was this article helpful?

0 0

Post a comment