Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title
Copyright
Dedication
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Getting Started
An Introduction to WordPress
Community
The Codex
WordPress Themes
Default Themes
WordPress in the near future
Features as Plugins
The next default theme Twenty Fourteen
Themes from Scratch versus Premade
PHP in WordPress
Functions
Objects and Classes
Alternate Syntax for Control Structures
Coding Standards
Debugging WordPress
Summary
Chapter 2: Theme Anatomy and Template Hierarchy
The Bare Minimum
The index.php File
The style.css File
Basic Template Files
header.php
footer.php
sidebar.php
comments.php
searchform.php
Including Basic Template Files
Functions File
Template Hierarchy
page.php
single.php
archive.php
front-page.php
home.php
search.php
404.php
Custom Template Files
Post Formats
Template Parts
More Theme Setup
Theme Folder Structure
Loading Styles and Scripts
Conditional Tags
Find Out Which Template Is Being Used
Building Your Theme, Part 1
Folder Structure
Base Template Files
Starter Templates
Summary
Chapter 3: Content Options and the Loop
WP_Query
Constructing the Page
Get Query Parameters
Decide on Template File
The Loop
have_posts
the_post()
Do You Need to “Loop” Every Time?
Custom and Dynamic Content with Queries
Methods of Querying in WordPress
Modifying the Default Query
Multiple Loops
Advanced Queries
Pagination with Custom Queries
Properties and Global Variables
WP_Query Properties
Globals
Template Tags
Template Tag Varieties
Template Tags and the Loop
Display, Return, or Both
Passing Tag Parameters
Using body_class( ) and post_class( )
More Useful Classes with Hooks
Styling Sticky Posts
A Note on HTML IDs
Building Your Theme, Part 2
Content First
Adding Code to Your Templates
Summary
Chapter 4: Using Custom Post Types
Everything Is a Post
When Do I Need a Custom Post Type?
What Is a Custom Post Type Used for?
Creating Custom Post Types
Naming Conventions
Using a Plugin or the Theme Functions File
Setting a Basic Custom Post Type
Full Setup and Advanced Options for Custom Post Types
Customizing the Admin Interfaces
Plugins and Code Generators
Displaying Custom Post Types
Querying with Custom Post Types
Custom Post Type Templates
Extending Post Types
Post Type Supports
Customizing the Post Type Overview Screen
Add Post Types to Feed
Building Your Theme, Part 3
Adding Custom Post Types
Post Type Templates
Content
Summary
Chapter 5: Creating Custom Taxonomies and Fields
Introducing Taxonomies
When Do I Need a Custom Taxonomy?
Creating Custom Taxonomies
Naming Conventions
Setting Up a Basic Custom Taxonomy
Full Setup of a Custom Taxonomy
Contextual Help and Help Tabs
Displaying Posts by Custom Taxonomy
The tax_query Parameter
Custom Taxonomy Templates
Displaying Custom Taxonomy Information
Listing All Taxonomy Terms
Terms by Post
Introducing Custom Fields
Custom Field Functions
add_post_meta
update_post_meta
delete_post_meta
get_post_meta
Custom Metaboxes
add_meta_box
Initializing the Metabox
Adding Content to the Metabox
Saving Metabox Data
Conditional Display of Custom Metaboxes
Building Queries with Custom Fields
Adding Custom Fields to the Feed
Creating an Advanced Search Form with Custom Taxonomies and Custom Fields
Taxonomy Drop-Down Input
Building the Search Form
Setting Up the Search Query
Building Your Theme, Part 4
Adding Custom Taxonomies
Adding Custom Metaboxes
Setting Up the Menu Page
Displaying the Featured Menu Item
Summary
Chapter 6: Customize with Hooks, Shortcodes, and Widgets
Hooks
Why Actions Are Not Filters
When Do Actions and Filters Happen?
Using Hooks
Creating Custom Action Hooks
Creating Custom Filter Hooks
Debugging Hooks
Shortcodes
Creating Custom Shortcodes
Multiple Shortcodes with the Same Function
Making Shortcodes More User-Friendly
Widgets (and Dynamic Sidebars)
Dynamic Sidebars
Creating Custom Widgets
Building Your Theme, Part 5
Adding shortcodes
Adding Widgets to Your Theme
Spring Cleaning the functions File
Summary
Chapter 7: Theme Options and the Theme Customizer
Why Provide Theme Options?
Choosing the Right Options
Simple Customizations with Theme Features
Custom Backgrounds
Custom Headers
Saying Goodbye to Theme Options Pages
Introducing the Theme Customizer
Getting Started with the Theme Customizer
Adding Options to the Customizer
Using Settings in Your Theme
How Theme Settings Are Stored
Theme Mods
Options
Creating an Options Array
Data Sanitization in Theme Options
Creating Your Own Sanitization Functions
Automatically Update the Theme Customizer
Adding Live Preview to Default Options
Adding Custom Controls
Adding a Color Palette Selector
Building Your Theme, Part 6
Adding a Logo Option
Adding a Featured Post Option
Adding a Color Palette Option
Summary
Chapter 8: Users, Roles, and Capabilities
User System
Roles
Capabilities
Customizing Roles and Capabilities
How Roles and Capabilities Are Stored
The WP_Roles Class
WP_User Class
Custom User Capabilities
Customizing User Login
Customizing the Login Page
Creating a Custom User Login Page
Creating User-Only Content Areas
Managing Users and User Data
Creating Users
Updating and Deleting Users
Creating Custom User Data
Building Your Theme, Part 7
Summary
Chapter 9: Plugins: When the Time Is Right
Plugins Bring Power, but Can Also Facilitate Evil
Is a Plugin the Right Option?
Create a Plugin or Use the Theme Functions File?
Avoid Rewriting WordPress Core Functionality
Try to Avoid Plugins Forming the Core Functionality of Your Theme
Managing Your Theme or Selling/Distributing?
Making Your Theme Compatible with Plugins
How to Select a Plugin
A Note on Testing
WordPress Plugin Directory
Check the Details
Support and Documentation
Compatibility with Other Plugins
Look at the Competition
Useful Plugins
Site Management Plugins
Form Management Plugins
SEO Plugins
Extra Feature Plugins
Summary
Chapter 10: Security and Performance
Security
Backing Up WordPress
Theme Security
Securing the WordPress Login
General WordPress Security
General Security
Monitoring Security
Performance
Testing Performance
How Much Do You Need to Optimize?
KISS: Do the Simple Things that Make the Most Difference
Caching
Summary
Chapter 11: Distributing Your Theme
Before You Begin
Target Audience
Competition
What Features to Add
Theme Options and Customizations
Building Your Theme
Marketing
Building a Customer-Base
Creating a Marketing Web Site
Marketing Through Pricing
Tracking Metrics
Theme Testing
Theme Review Process
Testing Your Theme
Testing with a Fresh Perspective
Distributing Your Theme
Licensing Your Theme
Adding Your Theme to the Themes Directory
Selling Your Theme
Supporting Your Theme
Ways of Providing Support
Preventing Support Requests
Summary
Chapter 12: Extending Your Theme
Child Themes
Why Work with Child Themes?
When to Use a Child Theme
Creating a Child Theme
Child Themes Summary
WordPress Comments
Comments: An Overview
Working with Comments
Comments Template
Comments Form
Comments List
Comments Summary
Internationalization
How i18n Works in WordPress
Readying Text for Translation
Generating Translation Files
Internationalization Summary
Summary
Chapter 13: Plugin Development
Writing Your First Plugin
Plugin Names
Plugin Location and File Structure
Plugin File Header
How to Add Functionality
Encapsulating a Plugin in a Class
Actions and Filters from Within a Class
Template Tags from Within a Class
Dealing with Data
Creating a Table
Adding, Moving, and Updating Data
Querying the Data
Initializing and Cleaning Up
Admin Settings Pages
Adding Menu Pages
Settings API
Settings Link in the Plugins Management Page
Adding to the Plugin Repository
Preparing a Plugin
Submitting to the Repository
Updating a Plugin
Summary
Chapter 14: WordPress Multisite
When to Use Multisite
Advantages
Disadvantages
When Not to Use Multisite
Installing and Configuring Multisite
Prerequisites
Enabling Multisite
Enabling Multisite
Creating a New Site
Domain Mapping
Uninstalling Multisite
Users in Multisite
Super Admins and Site Admins
Managing Users in Multisite
General Implications of Multisite Users
Theme Development for Multisite
Multisite Stats and Information
Accessing Content Across the Network
Extending Your Themes for Multisite
Plugins with Multisite
Must-Use Plugins
Useful Plugins for Multisite
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →