2016 WordCamp Kansas City
Resources Available @ http://goo.gl/KaOIIn
This presentation will show how we plan the development of custom WordPress themes at Red8 Interactive using the WordPress template hierarchy as a guide. It will also delve into tools we use, like Grunt and Git, and how they improve our development process. And we’ll take a look at the benefits of implementing coding standards for your team.
This presentation is geared towards beginner developers looking to get a real world example of how these tools and processes can be put into use to plan and develop custom WordPress themes.
You won’t be an expert after this presentation, it is only 40 minutes after all, but you will have a solid foundation and resources to go further explore how these tools could improve your own development workflow.
1. Putting the Develop
in Development
Jason Yingling
@jason_yingling
Resources available: https://goo.gl/KaOIIn
[ ]
2. Who am I?Introduction
Who am I?
What We’ll Cover
Organizing a Project Director of Development, Red8 Interactive
3 plugins on WordPress.org repo
3 time WordCamp Speaker
Meetup and WordCamp organizer
@jason_yingling
Developing a Project
Further Resources
3. What We’ll Cover
How we plan a project at
Red8 Interactive
How we develop projects as a team
The tools and resources we use to
improve our development workflow
4. Organizing a ProjectIntroduction
Organizing a Project
@jason_yingling
Developing a Project
Further Resources
• Understanding the WordPress
template hierarchy
– Main Templates
– Commonly overlooked templates
• Breaking down what makes a
template
• Planning a project into templates
and template parts
5. Template Hierarchy
@jason_yingling
How WordPress determines
which template files to use
when displaying a post or page.
“
Introduction
Organizing a Project
Developing a Project
Further Resources
8. The Big Three
@jason_yingling
• Index.php – everything falls
back to index. Main post loop.
• Single.php – your single posts
• Page.php – your static pages
Introduction
Organizing a Project
Developing a Project
Further Resources
9. The Forgotten
@jason_yingling
• 404 page
• Search Results
• Archives
Introduction
Organizing a Project
Developing a Project
Further Resources
12. Developing a Project
@jason_yingling
• Code to the standards
• Automate your workflow
• Version control your code
Introduction
Organizing a Project
Further Resources
Developing a Project
13. Coding Standards
@jason_yingling
• Learn the WordPress way
• Easier for others to pick up
• Easier for you to pick up others
code
• Helps make code self-
documenting
• Check the Codex
Introduction
Organizing a Project
Further Resources
Developing a Project
14. PHP Standards
@jason_yingling
• Don’t camelCase function
names. Use lowercase and “_”
for spaces
• No shorthand
• Use real tabs and not spaces
Introduction
Organizing a Project
Further Resources
Developing a Project
15. Automate It
@jason_yingling
• Problem: Doing things takes
time.
• Solution: Make the computer do
it for you!
Introduction
Organizing a Project
Further Resources
Developing a Project
16. “
Why use a task
runner?
In one word: automation. The less work you
have to do when performing repetitive tasks like
minification, compilation, unit testing, linting,
etc, the easier your job becomes.
- Gruntjs.com
21. “
What is git?
Git is known as a "distributed" (rather than
"centralized") version control system because
you can run it locally and disconnected from the
Internet, and then "push" your changes to a
remote system (such as GitHub) whenever you
like.
22. Tips for Successful Version
Controlling
@jason_yingling
Introduction
Organizing a Project
Further Resources
Developing a Project
• Write useful commit messages
• Implement features as they’re
ready
• Have a strategy in place
27. Further Resources
@jason_yingling
Introduction
Organizing a Project
Further Resources
Developing a Project
• Post Status (Blog)
• WP Tavern (Blog)
• Smashing WordPress (Book)
• Up and Running (Book)
• Post Status Draft (Podcast)
• Apply Filters (Podcast)
Allows for teams to easily use the same tools
Can version control the various Grunt plugins used in a project
Both JS based task runners
Grunt has been around longer so it has a bit bigger user base and more plugins already built
Gulp is newer and growing fast. More focused on speed
But Grunt has implemented some of Gulp’s speed advantages itself
Take a look inside a our Grunt file
Allows for teams to easily use the same tools
Can version control the various Grunt plugins used in a project
The basic workflow only really requires 7 git commands
git stash is a special bonus
clone let’s you clone a repo url
checkout let’s you checkout a branch or create a new branch on a repo
add lets you add files contents to the index
commit lets you insert the files into the repository
merge lets you merge changes between branches
pull lets you pull from the remote repository to your local
push lets you push changes from your local branch to the remote repo
stash lets you remove the changes from one branch, move to another, and apply them there
Git4WP is a free video course from the developer behind the WP Pusher plugin
- Second
Git4WP is a free video course from the developer behind the WP Pusher plugin
- Second
Git4WP is a free video course from the developer behind the WP Pusher plugin
- Second
Git4WP is a free video course from the developer behind the WP Pusher plugin
- Second