what you don't know you can do -- wordpress development for absolutely everyone!

52
What You Don't Know You Can Do — WordPress Development for Absolutely Everyone Tracy Levesque • @LilJimmi [email protected] What You Don't Know You Can Do WordPress Development for Absolutely Everyone With Tracy Levesque / @liljimmi

Upload: yikes-inc

Post on 27-Jan-2015

103 views

Category:

Technology


0 download

DESCRIPTION

Do you think tapping into “advanced” WordPress functionality is only for developers? Power users and designers can build a site that takes advantage of all that WordPress has to offer. Learn about Templates, Custom Post Types, Custom Taxonomies, The Loop, Hooks, Actions & Filters and how power users and designers can use them to build a great site with custom functionality.

TRANSCRIPT

Page 1: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

What You Don't Know You Can Do — WordPress Development for Absolutely EveryoneTracy Levesque • • @LilJimmi [email protected]

What You Don't Know You Can Do

WordPress Development forAbsolutely Everyone

With Tracy Levesque / @liljimmi

Page 2: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hi, I'm Tracy.

Page 3: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

I am a Power User

Page 4: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

I know HTML

Page 5: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

I know CSS

Page 6: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

I don't know PHP

Page 7: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

There are many folks with skill setssimilar to mine.

And we can develop for WordPress, too!

Page 8: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

WordPress Development

Demystified!I'm going to go through some terms being thrown aroundon that other track and explain what they are, what they

can do, and how to use them.

Page 9: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPressTemplateHierarchy

Page 10: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template Hierarchycodex.wordpress.org says:

WordPress uses the Query String — informationcontained within each link on your web site — todecide which template or set of templates will be

used to display the page.

Page 11: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyTranslation

Templates are cool because if you name a template file acertain way, it will automatically apply to a certain page.

There's a that shows how the

naming conventions work.

chart on WordPress.org

Page 12: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

OMG

Page 13: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyWhat it is

The chart looks confusing, but it's really pretty simple.

Page 14: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyWhat it is

Templates are the files in a theme that tell WordPresshow to display your pages. They live in the theme's folder.

Page 15: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyThey're like different frames for your content

Page 16: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyWhat it is

Templates handle the display of different pages on yourWordPress site such as...

The main list of posts (the blog page)A regular pageAn archive page (Category, Tag, Author, Date pages)A single post pageThe search results pageEtc...

Page 17: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyWhat it can do

If you name template files a certain way they will affectthe display of those pages.

Page 18: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyTwentytwelve example

Page 19: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The WordPress Template HierarchyHow you can use it

Power users - Look for a theme or theme framework thatallows you to add/modify templates.

Designers - Make them yourself! Just follow the chart.

Page 20: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The Loop

Page 21: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The Loopcodex.wordpress.org says:

The Loop is PHP code used by WordPress todisplay posts.

Page 22: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopTranslation

The Loop is a set of instructions in a template that grabscontent and displays it on a page.

It's called a "loop" because the set of instructions can berepeated multiple times on a page.

Page 23: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopThe Loop is like making sandwiches.

Page 24: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopTo make a sandwich you collect a set of ingredients

and assemble it

Page 25: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopYou repeat the steps of collecting and assembling as

many times as needed

Page 26: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopWhat it is

Within The Loop are the main parts of a page or post.These are like the slices of bread in our sandwich.

TitleContent

Page 27: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopWhat it is

You can also grab additional content, aka Metadata,attached to pages or posts. These are like the ingredients

in our sandwich.

AuthorDateFeatured ImageCategories (posts only)Tags (posts only)Etc.

Page 28: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopWhat it is

In The Loop you can provide instructions that determinewhich posts are shown.

For example we could have the following instructions:

Only show posts from the "Pets" categoryIf a post is tagged "kittens" add a special style to itIf a post is tagged "dogs" don't show it

Page 29: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopWhat it can do

Custom loop example on the site.moviefanfare.com

Page 30: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

The LoopHow you can use it

Power users - Look for a theme, theme framework orplugin that allows you to modify the display of the posts

page.

Designers - Dig into the loop in your theme or childtheme and start modifying! Check out

in the WordPress Codex.The Loop in Action

Page 31: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom PostTypes

Page 32: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post Typescodex.wordpress.org says:

A Custom Type is a Post Type you define.

Page 33: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesTranslation

Normally you only have 2 types of content to choosefrom: Pages and Posts. Guess what — you can make

more!

Page 34: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesWhat they are

Pages and Posts are both Post Types. They...

Are types of content with their own sets of fieldsHave their own admin area in the WordPress adminLet you add content in a repeating and consistentmannerHave a consistent layout (by default) on the front-end ofyour site.

Page 35: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesWhat they are

So instead of just

You could have

Page 36: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesReally, the possibilities are endless

Page 37: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesWhat they can do

Custom Post Types can also have their own customtaxonomies. That just means they can have their own

ways to group posts together.

Categories and Tags are taxonomies for Posts andPages.

Page 38: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesWhat they can do

If we created a custom post type called "Movies" somecustom taxonomies we could use are

Genre, Year, Director and Rating

With these custom taxonomies you would have archivepages to see all movies by genre, year, etc.

Page 39: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesStatic Guard example

For we created 3 custom post types:

Products, Stylists and Tips

mystaticguard.com

Page 40: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesStatic Guard example

With Custom taxonomies, The Loop and the WordPressTemplate Hierarchy, the site is easy-to-manage.

Page 41: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesHow you can use them

Power users - that allows you to create

Custom Post Types.

Use a plugin

Designers - Code your own. Really! I have that shows you how.a how-to video on WordPress.tv

Page 42: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actionsand Filters

Page 43: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and Filterscodex.wordpress.org says:

Hooks are provided by WordPress to allow yourplugin to 'hook into' the rest of WordPress...There

are two kinds of hooks:Actions: A custom PHP function defined in yourplugin (or theme) and hooked, i.e. set torespond, to specific events that take place inWordPress.Filters: Functions that WordPress passes datathrough, at certain points in execution, justbefore taking some action with the data

Page 44: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersTranslation

Hooks, Actions and Filters allow you to change WordPressfunctionality without breaking it.

Page 45: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Custom Post TypesWhat they are

Hooks - Points at which WordPress allows you to tap intoa function and safely modify it.

Some examples are:

Changing the length of the excerptChanging the order of menu items in the adminAdding content to the beginning or end of every postAdding Custom Post TypesAdding Sidebars

Page 46: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersWhat they are

Actions - A hook that makes something new happenwhen a WordPress function is triggered.

Page 47: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersWhat they are

Filters - A hook that modifies a WordPress function whenit is triggered.

Page 48: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersWhat they are

Now is when I do my awesome, visual illustration ofHooks, Actions and Filters using a volunteer from the

audience.

Page 49: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersWhat they can do

Hooks, Actions and Filters are what makes WordPressgreat software for building an amazing site.

Page 50: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Hooks, Actions and FiltersHow you can use them

Power users - If you've ever installed a plugin you areusing them already.

Designers - Dig into the and

start adding functionality to your themes.

WordPress Codex article on Theme Development

Page 51: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

Resources - The #1 place to find the best

WordPress development information. - From the

Codex - A handy

site that creates CPT code for you. - A list of

theme frameworks that allow power users to createextended functionality for WordPress.

The WordPress Codex

WordPress Terminology Related to Design

WordPress Custom Post Type Generator

Guide to WordPress Theme Frameworks

Page 52: What You Don't Know You Can Do --  WordPress Development for Absolutely Everyone!

THE ENDQuestions?

Slides available on Slideshare: slideshare.net/TheTracyL