204
PUBLIC RELEASE WordPress THEME — for — HOW TO prepare a

How to Prepare a WordPress Theme for Public Release

Embed Size (px)

DESCRIPTION

A presentation for WordCamp Louisville on how to prepare a theme for distribution. It mainly follows the theme review process outlined at WordPress.org. It also discusses reasons to release a theme and briefly highlights ways to stand out from the crowd.

Citation preview

Page 1: How to Prepare a WordPress Theme for Public Release

PU

BLIC

R

ELEAS

E

WordPress THEME —

for —

HOW TO prepare a

Page 2: How to Prepare a WordPress Theme for Public Release

DAVID YEISER

— on —twitter: @davidyeiser

the web: designintellection.com

Page 3: How to Prepare a WordPress Theme for Public Release

1. Why release a theme?

2. The process.3. Ways to stand-out.

Page 4: How to Prepare a WordPress Theme for Public Release

THEME?WHAT IS A

THEME?

Page 5: How to Prepare a WordPress Theme for Public Release

wp-admin/wp-content/— themes/— — default/— — your-theme/wp-includes/

Page 6: How to Prepare a WordPress Theme for Public Release
Page 7: How to Prepare a WordPress Theme for Public Release

WHY RELEASEa theme?WHY RELEASE

Page 8: How to Prepare a WordPress Theme for Public Release

• Give back to the community• Learn something new• Get noticed• Build a reputation• Get paid work

a theme?WHY RELEASE

• Publish!

Page 9: How to Prepare a WordPress Theme for Public Release

GIVE BACKGIVE BACK

:)

Page 10: How to Prepare a WordPress Theme for Public Release

LEARNLEARN

• Child themes• Product development• Community management• Professional development

Page 11: How to Prepare a WordPress Theme for Public Release

GET NOTICEDGET NOTICED

THEMES24,038,221 downloads

PLUGINS

132,931,828 downloads

Numbers as of 2010-12-01

TOTAL downloads

Page 12: How to Prepare a WordPress Theme for Public Release

GET NOTICEDGET NOTICED

THEMES18,562 downloads/theme

PLUGINS10,919 downloads/plugin

Numbers as of 2010-12-01

AVG. PER ITEM downloads

Page 13: How to Prepare a WordPress Theme for Public Release

GET NOTICEDGET NOTICED

Page 14: How to Prepare a WordPress Theme for Public Release

GET NOTICEDGET NOTICED

Embrace Distribution channels

Page 15: How to Prepare a WordPress Theme for Public Release

GET NOTICEDGET NOTICED

Page 16: How to Prepare a WordPress Theme for Public Release

REPUTATIONREPUTATIONPRODUCT PLATFORM

+

Page 17: How to Prepare a WordPress Theme for Public Release

REPUTATIONREPUTATION

Attainable.But not easy.Blogging is hard.

Page 18: How to Prepare a WordPress Theme for Public Release

PAID WORKPAID WORK

Page 19: How to Prepare a WordPress Theme for Public Release

PAID WORKPAID WORK

Page 20: How to Prepare a WordPress Theme for Public Release

PAID WORKPAID WORK

Page 21: How to Prepare a WordPress Theme for Public Release

PUBLISHPUBLISH

Page 22: How to Prepare a WordPress Theme for Public Release

Magnolia

Page 23: How to Prepare a WordPress Theme for Public Release

GitHub: https://github.com/davidyeiser/magnoliaTrac Ticket: http://themes.trac.wordpress.org/ticket/2215

Magnolia

Page 24: How to Prepare a WordPress Theme for Public Release

THE PROCESSSix stepsTHE PROCESS

Page 25: How to Prepare a WordPress Theme for Public Release

Six stepsTHE PROCESS

1. PLAN2. DESIGN3. BUILD4. TEST & CHECK5. RELEASE6. SUPPORT

Page 26: How to Prepare a WordPress Theme for Public Release

PLANPLAN

Photo credit: http://www.flickr.com/photos/pepemichelle/3645214132/

Page 27: How to Prepare a WordPress Theme for Public Release

PLANPLAN

OUT IN

Page 28: How to Prepare a WordPress Theme for Public Release

PLANPLAN

OUT IN

NO MAN’S LAND

Page 29: How to Prepare a WordPress Theme for Public Release

PLANFocusPLAN

• A certain market?• A particular audience?• Scratching your own itch?

Page 30: How to Prepare a WordPress Theme for Public Release

PLANBrowser supportPLAN

• Largely determined by target audience and goals• But ultimately up to you

Page 31: How to Prepare a WordPress Theme for Public Release

PLAN• FREE

PLAN

• FREEMIUM• PREMIUM

Page 32: How to Prepare a WordPress Theme for Public Release

DESIGNDESIGN

• Browser or graphics editor first• Then integrate WordPress

Page 33: How to Prepare a WordPress Theme for Public Release

DESIGN

Page 34: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 35: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 36: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 37: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 38: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 39: How to Prepare a WordPress Theme for Public Release

DESIGNranges not extremesDESIGN FOR

Page 40: How to Prepare a WordPress Theme for Public Release

BUILDBUILD

Page 41: How to Prepare a WordPress Theme for Public Release

wp-admin/wp-content/— themes/— — default/— — your-public-theme/— — — index.php— — — style.csswp-includes/

20

04

Page 42: How to Prepare a WordPress Theme for Public Release

wp-admin/wp-content/— themes/— — default/— — your-public-theme/— — — header.php— — — index.php— — — style.css— — — rtl.css— — — comments.php— — — front-page.php— — — home.php— — — single.php— — — page.php— — — category.php— — — tag.php— — — taxonomy.php— — — author.php— — — date.php— — — archive.php— — — search.php— — — attachment.php— — — image.php— — — 404.php— — — footer.phpwp-includes/

20

10

Page 43: How to Prepare a WordPress Theme for Public Release

wp-admin/wp-content/— themes/— — default/— — your-public-theme/— — — header.php— — — index.php— — — style.css— — — rtl.css— — — comments.php— — — front-page.php— — — home.php— — — single.php— — — page.php— — — category.php— — — tag.php— — — taxonomy.php— — — author.php— — — date.php— — — archive.php— — — search.php— — — attachment.php— — — image.php— — — 404.php— — — footer.phpwp-includes/

20

10

Page 44: How to Prepare a WordPress Theme for Public Release

Advanced

Page 45: How to Prepare a WordPress Theme for Public Release

> Be > consitent> in> your> code.

Page 46: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

Page 47: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

header.identity .site-title { … }

h2.site-tagline { … }

BAD!

Page 48: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

header.identity .site-title { … }

h2.site-tagline { … }

BAD!

Page 49: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

header.identity .site-title { … }

h2.site-tagline { … }

BAD!

Page 50: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

header.identity .site-title { … }

h2.site-tagline { … }

BAD!

Page 51: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

.site-title { … }

.site-tagline { … }

GOOD!

Page 52: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

.site-title { … }

.site-tagline { … }

GOOD!

Page 53: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

.site-title { … }

.site-tagline { … }

GOOD!

Page 54: How to Prepare a WordPress Theme for Public Release

MARKUP<header class="identity">

<hgroup>

<h1 class="site-title">Acme Publishing</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

STYLE.CSS

.identity { … }

.site-title { … }

.site-tagline { … }

GOOD!

Page 55: How to Prepare a WordPress Theme for Public Release

Good-- file-- -- organization

Page 56: How to Prepare a WordPress Theme for Public Release

SOMETHEME/

archive.php

footer.php

header.php

html5.js

ie.css

ie6.css

index.php

jquery-latest.js

page.php

screenshot.png

search.php

single.php

spacer.gif

style.css

BAD!

Page 57: How to Prepare a WordPress Theme for Public Release

SOMETHEME/

archive.php

/css/

-- ie.css

-- ie6.css

footer.php

header.php

/images/

-- spacer.gif

index.php

/js/

-- html5.js

-- jquery-latest.js

page.php

screenshot.png

search.php

single.php

style.css GOOD!

Page 58: How to Prepare a WordPress Theme for Public Release

SOMETHEME/

/_css/

-- ie.css

-- ie6.css

/_images/

-- spacer.gif

/_js/

-- html5.js

-- jquery-latest.js

archive.php

footer.php

header.php

index.php

page.php

screenshot.png

search.php

single.php

style.css GOOD!

Page 59: How to Prepare a WordPress Theme for Public Release

Use dynamic paths.Not relative.

Page 60: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="/">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

BAD!

Page 61: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="/">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

BAD!

Page 62: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="<?php echo home_url(); ?>">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

GOOD!

Page 63: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="<?php echo home_url(); ?>">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

GOOD!

Page 64: How to Prepare a WordPress Theme for Public Release

Watch out for

DEPRECATEDfunction calls.

Page 65: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="<?php echo home_url(); ?>">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

GOOD!

Page 66: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="<?php get_option("home"); ?>">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

BAD!

Page 67: How to Prepare a WordPress Theme for Public Release

CODE<header class="identity">

<hgroup>

<h1 class="site-title">

<a href="<?php get_option("home"); ?>">Acme Publishing</a>

</h1>

<h2 class="site-tagline">A clear, concise company description.</h2>

</hgroup>

</header>

BAD!

Page 68: How to Prepare a WordPress Theme for Public Release

Theme Unit Test

BOOKMARKhttp://codex.wordpress.org/Theme_Unit_Test

Page 69: How to Prepare a WordPress Theme for Public Release
Page 70: How to Prepare a WordPress Theme for Public Release
Page 71: How to Prepare a WordPress Theme for Public Release

style.css

header.php

index.php

footer.php

Page 72: How to Prepare a WordPress Theme for Public Release

style.css

header.php

index.php

⇒ single.php⇒ page.php⇒ archive.phpfooter.php

Page 73: How to Prepare a WordPress Theme for Public Release

404.php

archive.php

comments.php

/css/

footer.php

functions.php

header.php

index.php

/js/

license.txt

page.php

README.txt

screenshot.png

search.php

sidebar.php

single.php

style.css

Page 74: How to Prepare a WordPress Theme for Public Release
Page 75: How to Prepare a WordPress Theme for Public Release

STYLE.CSS

table { width:100%; margin-bottom:22px; border-bottom:2px solid #ccc; }

th { padding:5px; border-right:1px solid #ccc; border-bottom:1px solid

#ccc; background-color:#ddd; }

td { padding:4px 5px; border-bottom:1px solid #eee; }

Page 76: How to Prepare a WordPress Theme for Public Release
Page 77: How to Prepare a WordPress Theme for Public Release

Further…

• “Native” support for popular plugins• Look at plugins for WordPress.com• Add theme options

Page 78: How to Prepare a WordPress Theme for Public Release

TEST & CHECKTEST & CHECK

BOOKMARKhttp://codex.wordpress.org/Theme_Review

Page 79: How to Prepare a WordPress Theme for Public Release

Themes are required not to have any notices, warnings, errors; or use of deprecated functions.

CODE QUALITY

wp-config.php

define('WP_DEBUG', true);

Page 80: How to Prepare a WordPress Theme for Public Release

Themes are required to utilize current recognized version(s) of (X)HTML and CSS.

CODE QUALITY

NOT (entirely) TRUE!

Page 81: How to Prepare a WordPress Theme for Public Release

Twenty Ten Theme

header.php

<!DOCTYPE html>

Page 82: How to Prepare a WordPress Theme for Public Release

Themes are required to generate no JavaScript errors.

CODE QUALITY

Sounds good.

Page 83: How to Prepare a WordPress Theme for Public Release

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

• <html> tag includes language_attributes()

• Correct XFN profile link in <head> tag: <head profile="http://gmpg.org/xfn/11"> (Exception: Wholly HTML 5 themes must not have the profile, as HTML 5 does not support it.)• Correct content-type meta declaration

• <title> includes bloginfo() for title and description

CODE QUALITY

Page 84: How to Prepare a WordPress Theme for Public Release

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

CODE QUALITY

Page 85: How to Prepare a WordPress Theme for Public Release

With HTML 5 it’s simple.

CODE QUALITY: Valid Doctype

header.php

<!DOCTYPE html>

Page 86: How to Prepare a WordPress Theme for Public Release

CODE QUALITY

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

• <html> tag includes language_attributes()

Page 87: How to Prepare a WordPress Theme for Public Release

CODE QUALITY: language_attributes()

header.php

<html <?php language_attributes(); ?>>

Page 88: How to Prepare a WordPress Theme for Public Release

CODE QUALITY

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

• <html> tag includes language_attributes()

• Correct XFN profile link in <head> tag: <head profile="http://gmpg.org/xfn/11"> (Exception: Wholly HTML 5 themes must not have the profile, as HTML 5 does not support it.)

Page 89: How to Prepare a WordPress Theme for Public Release

HTML5 exception

CODE QUALITY: XFN Profile link

header.php

<head>

Page 90: How to Prepare a WordPress Theme for Public Release

CODE QUALITY

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

• <html> tag includes language_attributes()

• Correct XFN profile link in <head> tag: <head profile="http://gmpg.org/xfn/11"> (Exception: Wholly HTML 5 themes must not have the profile, as HTML 5 does not support it.)

• Correct content-type meta declaration

Page 91: How to Prepare a WordPress Theme for Public Release

Again, with HTML 5 it’s easy.

CODE QUALITY: Content-Type

header.php

<head>

<meta charset="<?php bloginfo('charset'); ?>" />

Page 92: How to Prepare a WordPress Theme for Public Release

CODE QUALITY

Themes are required to have a valid HTML document HEAD:

• Valid DOCTYPE declaration

• <html> tag includes language_attributes()

• Correct XFN profile link in <head> tag: <head profile="http://gmpg.org/xfn/11"> (Exception: Wholly HTML 5 themes must not have the profile, as HTML 5 does not support it.)

• Correct content-type meta declaration

• <title> includes bloginfo() for title and description

Page 93: How to Prepare a WordPress Theme for Public Release

Copied from the Twenty Ten theme.

CODE QUALITY: <title> tag

header.php

<title>

<?php

// Print the <title> tag based on what is being viewed.

// Taken from the 2010 theme.

global $page, $paged;

wp_title('&mdash;', true, 'right');

// Add the blog name.

bloginfo('name');

// Add the blog description for the home/front page.

$site_description = get_bloginfo('description', 'display');

if ($site_description && (is_home() || is_front_page()))

echo " &mdash; $site_description";

// Add a page number if necessary:

if ($paged >= 2 || $page >= 2)

echo ' &mdash; ' . sprintf('Page %s', max($paged, $page));

?>

</title>

Page 94: How to Prepare a WordPress Theme for Public Release

Theme is required to incorporate the following WordPress core functionality:

FUNCTIONALITY

Page 95: How to Prepare a WordPress Theme for Public Release

Theme is required to incorporate the following WordPress core functionality:

• Automatic Feed Links

FUNCTIONALITY

Page 96: How to Prepare a WordPress Theme for Public Release

Add default posts and comments RSS feed links via wp_head()

FUNCTIONALITY: Automatic Feed Links

functions.php

// Add default posts and comments RSS feed links to head

add_theme_support('automatic-feed-links');

Page 97: How to Prepare a WordPress Theme for Public Release

Theme is required to incorporate the following WordPress core functionality:

• Automatic Feed Links• Widgets

FUNCTIONALITY

Page 98: How to Prepare a WordPress Theme for Public Release

Initiate widget area in the admin and set HTML output. (1 of 2)

FUNCTIONALITY: Widgets

functions.php

function magnolia_widgets_init() {

register_sidebar(array(

'name' => 'Main Sidebar',

'id' => 'main-sidebar',

'description' => 'The main sidebar of the site.',

'before_widget' => '<section id="%1$s" class="secondary-block %2$s"><div>',

'after_widget' => '</div></section>',

'before_title' => '</div><header class="secondary-block-label"><h1 class="secondary-

block-title">',

'after_title' => '</h1></header><div class="secondary-block-content">',

));

}

//Register sidebars by running magnolia_widgets_init() on the widgets_init hook.

add_action('widgets_init', 'magnolia_widgets_init');

Page 99: How to Prepare a WordPress Theme for Public Release

Define widget area in theme. (2 of 2)

FUNCTIONALITY: Widgets

sidebar.php

<?php if (!dynamic_sidebar('main-sidebar')) : ?>

<!-- STUFF -->

<?php endif; ?>

Page 100: How to Prepare a WordPress Theme for Public Release

Theme is required to incorporate the following WordPress core functionality:

• Automatic Feed Links• Widgets• Comments

FUNCTIONALITY

Page 101: How to Prepare a WordPress Theme for Public Release

Set single comment display and functionality (taken from Twenty Ten theme). (1 of 4)

FUNCTIONALITY: Comments

functions.php

if (!function_exists('magnolia_comment')) :

function magnolia_comment($comment, $args, $depth) {

// Comment function data from Twenty Ten theme.

}

endif;

Page 102: How to Prepare a WordPress Theme for Public Release

PHP template tag to output appropriate JS for threaded comments. (2 of 4)

FUNCTIONALITY: Comments

header.php

<?php if (is_singular()) { wp_enqueue_script('comment-reply'); } ?>

<?php wp_head(); ?>

</head>

Page 103: How to Prepare a WordPress Theme for Public Release

PHP template tag to output appropriate JS for threaded comments. (2 of 4)

FUNCTIONALITY: Comments

Page 104: How to Prepare a WordPress Theme for Public Release

PHP template tag to output appropriate JS for threaded comments. (2 of 4)

FUNCTIONALITY: Comments

Page 105: How to Prepare a WordPress Theme for Public Release

Call comments.php from single.php (and page.php). (3 of 4)

FUNCTIONALITY: Comments

single.php & page.php

<aside class="comments">

<?php

// The first parameter is the file to call. Defaults to comments.php.

// The second parameter is whether to separate comments by comment type.

// (pingback, trackbacks, comment, etc.)

comments_template('', true);

?>

</aside>

Page 106: How to Prepare a WordPress Theme for Public Release

Copied from Twenty Ten theme. (4 of 4)

FUNCTIONALITY: Comments

comments.php

// OTHER STUFF

// Copied from Twenty Ten theme.

// Have to change a few things though.

// Primarily the call to the function we created in functions.php

<?php wp_list_comments(array('callback' => 'magnolia_comment')); ?>

// OTHER STUFF

Page 107: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

FUNCTIONALITY

Page 108: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

• Navigation Menus

FUNCTIONALITY

Page 109: How to Prepare a WordPress Theme for Public Release

Register the navigation menu. (1 of 2)

FUNCTIONALITY: Navigation Menus

functions.php

// This theme uses wp_nav_menu() in one location.

register_nav_menus(array(

'primary' => 'Primary Navigation',

));

Page 110: How to Prepare a WordPress Theme for Public Release

Add it to the theme. (2 of 2)

FUNCTIONALITY: Navigation Menus

header.php

<?php if (has_nav_menu('primary')) { ?>

<nav class="main-nav">

<?php

wp_nav_menu(

array(

'theme_location' => 'primary',

'container' => '',

'menu_class' => 'main-nav-list',

'depth' => '0', // Sub pages are shown beneath the tabs.

)

);

?>

<span class="clear"></span>

</nav>

<?php } ?>

Page 111: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

• Navigation Menus• Post Thumbnails

FUNCTIONALITY

Page 112: How to Prepare a WordPress Theme for Public Release

Register support. (1 of 2)

FUNCTIONALITY: Post Thumbnails

functions.php

// This theme uses post thumbnails

add_theme_support('post-thumbnails');

Page 113: How to Prepare a WordPress Theme for Public Release

Add it to the theme. (2 of 2)

FUNCTIONALITY: Post Thumbnails

single.php, index.php & archive.php

<?php if (has_post_thumbnail()) { ?>

<p class="post-thumbnail"><?php the_post_thumbnail('thumbnail'); ?></p>

<?php } ?>

Page 114: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

• Navigation Menus• Post Thumbnails• Custom Header

FUNCTIONALITY

Page 115: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

• Navigation Menus• Post Thumbnails• Custom Header• Custom Background

FUNCTIONALITY

Page 116: How to Prepare a WordPress Theme for Public Release

Theme is recommended to incorporate the following WordPress core functionality, but is not required to do so.

• Navigation Menus• Post Thumbnails• Custom Header• Custom Background• Visual Editor CSS

FUNCTIONALITY

Page 117: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

TEMPLATE TAGS & HOOKS

Page 118: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

TEMPLATE TAGS & HOOKS

Page 119: How to Prepare a WordPress Theme for Public Release

Required to be placed directly before the <body> tag.

TEMPLATE TAGS & HOOKS

header.php

<?php wp_head(); ?>

</head>

Page 120: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

TEMPLATE TAGS & HOOKS

Page 121: How to Prepare a WordPress Theme for Public Release

Goes inside the <body> tag.

TEMPLATE TAGS & HOOKS

header.php

<body <?php body_class(); ?>>

Page 122: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

• $content_width

TEMPLATE TAGS & HOOKS

Page 123: How to Prepare a WordPress Theme for Public Release

Used for images and content.

TEMPLATE TAGS & HOOKS

functions.php

/* Set width for content and images.

--- The layout is fluid with max- and min-width constraints.

The value below represents the half-way width between

*/

if (!isset($content_width))

$content_width = 556;

Page 124: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

• $content_width

• post_class()

TEMPLATE TAGS & HOOKS

Page 125: How to Prepare a WordPress Theme for Public Release

Same as the body_class() but for posts.

TEMPLATE TAGS & HOOKS

index.php, single.php & archive.php

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

Page 126: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

• $content_width

• post_class()

• wp_link_pages()

TEMPLATE TAGS & HOOKS

Page 127: How to Prepare a WordPress Theme for Public Release

If a post or page is paginated.

TEMPLATE TAGS & HOOKS

index.php, single.php & archive.php

<?php wp_link_pages(array('before' => '<div class="post-pages">' . '<span class="post-pages-

label">Pages:</span> ', 'after' => '</div>')); ?>

Page 129: How to Prepare a WordPress Theme for Public Release

Comment pagination. (Lifted from the Twenty Ten theme.)

TEMPLATE TAGS & HOOKS

comments.php

<?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>

<div class="navigation">

<div class="nav-previous"><?php previous_comments_link('<span class="meta-

nav">&larr;</span> Older Comments'); ?></div>

<div class="nav-next"><?php next_comments_link('Newer Comments <span class="meta-

nav">&rarr;</span>'); ?></div>

</div>

<?php endif; ?>

Page 130: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

• $content_width

• post_class()

• wp_link_pages()

• paginate_comments_links() or previous_comments_link()/next_comments_link()

• posts_nav_link(), or previous_posts_link()/next_posts_link(), or paginate_links()

TEMPLATE TAGS & HOOKS

Page 131: How to Prepare a WordPress Theme for Public Release

Navigating posts on a per-page basis.

TEMPLATE TAGS & HOOKS

index.php & archive.php

<?php if ($wp_query->max_num_pages > 1) : ?>

<section id="post-nav-below" class="post-nav">

<span class="post-nav-older"><?php next_posts_link('&#8592; Older posts'); ?></span>

<span class="post-nav-newer"><?php previous_posts_link('Newer posts &#8594;'); ?></

span>

<span class="clear"></span>

</section>

<?php endif; ?>

Page 132: How to Prepare a WordPress Theme for Public Release

Navigating posts on an individual basis.

TEMPLATE TAGS & HOOKS

single.php

<section id="post-nav-below" class="post-nav post-nav-single post-nav-single-below">

<span class="post-nav-older"><?php previous_post_link('%link', '&#8592; Previous Post'); ?

></span>

<span class="post-nav-newer"><?php next_post_link('%link', 'Next Post &#8594;'); ?></span>

<span class="clear"></span>

</section>

Page 133: How to Prepare a WordPress Theme for Public Release

All template tags and hooks used in a Theme are required to be implemented properly. The following template tags and hooks are required to be included where appropriate:

• wp_head()

• body_class()

• $content_width

• post_class()

• wp_link_pages()

• paginate_comments_links() or previous_comments_link()/next_comments_link()

• posts_nav_link(), or previous_posts_link()/next_posts_link(), or paginate_links()

• wp_footer()

TEMPLATE TAGS & HOOKS

Page 134: How to Prepare a WordPress Theme for Public Release

Directly before the closing </body> tag.

TEMPLATE TAGS & HOOKS

footer.php

<?php wp_footer(); ?>

</body>

Page 135: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

Page 136: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

header.php

Page 137: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

header.php

<?php get_header(); ?>

GOOD!

Page 138: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

header.php<?php include(TEMPLATEPATH . '/header.php') ?>

BAD!

Page 139: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

header-secondary.php<?php get_template_part('header', 'secondary'); ?>

Page 140: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, standard template files are required to be called using the correct template tag

INCLUDING FILES

html5.js

<!--[if lt IE 9]>

<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>

<![endif]-->

Page 141: How to Prepare a WordPress Theme for Public Release

If incorporated into the Theme, site information is required to be called using the correct template tag.

SITE INFORMATION

This is what we talkedabout in the “Build” section

Page 142: How to Prepare a WordPress Theme for Public Release

Themes are required to support the following WordPress-defined CSS classes, or similar elements

Alignment Classes:.aligncenter

.alignleft

.alignright

Caption Related Classes:.wp-caption

.wp-caption-text

.gallery-caption

WORDPRESS-GENERATED CSS CLASSES

Page 143: How to Prepare a WordPress Theme for Public Release

Themes are required to support the following WordPress-defined CSS classes, or similar elements

Alignment Classes:.aligncenter

.alignleft

.alignright

Caption Related Classes:.wp-caption

.wp-caption-text

.gallery-caption

WORDPRESS-GENERATED CSS CLASSES

Page 144: How to Prepare a WordPress Theme for Public Release

Alignment classes

WORDPRESS-GENERATED CSS CLASSES

style.css

.post-content img { border:4px solid #ddd; }

.alignleft { margin:0 10px 10px 0; float:left; }

.alignright { margin:0 0 10px 10px; float:right; }

.aligncenter { display:block; margin:10px auto; text-align:center; }

Page 145: How to Prepare a WordPress Theme for Public Release

Alignment classes

WORDPRESS-GENERATED CSS CLASSES

Page 146: How to Prepare a WordPress Theme for Public Release

Themes are required to support the following WordPress-defined CSS classes, or similar elements

Alignment Classes:.aligncenter

.alignleft

.alignright

Caption Related Classes:.wp-caption

.wp-caption-text

.gallery-caption

WORDPRESS-GENERATED CSS CLASSES

Page 147: How to Prepare a WordPress Theme for Public Release

Caption classes

WORDPRESS-GENERATED CSS CLASSES

style.css

.wp-caption { padding:10px; background-color:#eee; -webkit-border-radius:5px; -moz-border-radius:

5px; border-radius:5px; }

.wp-caption-text { padding:5px 0 10px 0; font-size:13px; font-style:italic; line-height:16px;

color:#777; }

.post-content .gallery-item { padding-top:15px; padding-bottom:0; border-top:1px solid #eee; }

.post-content .gallery-icon { }

.post-content .gallery-caption { padding:0 10px 10px 10px; font-size:13px; font-style:italic;

line-height:16px; color:#777; }

Page 148: How to Prepare a WordPress Theme for Public Release

Caption classes

WORDPRESS-GENERATED CSS CLASSES

Page 149: How to Prepare a WordPress Theme for Public Release

Themes are recommended to support the following WordPress-generated classes.

Post Classes:.sticky

Comment Classes:.bypostauthor

WORDPRESS-GENERATED CSS CLASSES

Page 150: How to Prepare a WordPress Theme for Public Release

Themes are recommended to support the following WordPress-generated classes.

Post Classes:.sticky

Comment Classes:.bypostauthor

WORDPRESS-GENERATED CSS CLASSES

Page 151: How to Prepare a WordPress Theme for Public Release

Post “sticky” classes

WORDPRESS-GENERATED CSS CLASSES

style.css

.sticky { padding:30px 15px; border-top:4px solid #ddddc1; background-color:#ffffe3; }

.sticky .post-date { color:#adad93; }

.sticky .post-footer { background-image:none; border:1px solid #ddddc1; background-

color:#eeeed2; }

.sticky .post-meta { color:#adad93; border-bottom-color:#ddddc1; }

.sticky .post-meta em, .sticky .post-tags a { color:#adad93; }

.sticky .post-tags { border-top-color:#fffff3; }

.sticky .post-pages { border:1px dotted #ddddc1; }

.sticky .post-pages a { background-color:#ddddc1; }

.sticky .post-pages a:hover, .sticky .post-pages a:focus { background-color:#ccccb0; }

Page 152: How to Prepare a WordPress Theme for Public Release

Post “sticky” classes

WORDPRESS-GENERATED CSS CLASSES

Page 153: How to Prepare a WordPress Theme for Public Release

Themes are recommended to support the following WordPress-generated classes.

Post Classes:.sticky

Comment Classes:.bypostauthor

WORDPRESS-GENERATED CSS CLASSES

Page 154: How to Prepare a WordPress Theme for Public Release

Comment by post author classes

WORDPRESS-GENERATED CSS CLASSES

style.css

.commentlist .bypostauthor { padding:10px; border-bottom-color:#eeeed2; background-

color:#ffffe3; }

.bypostauthor .avatar { border-color:#ddddc1; }

.bypostauthor .comment-author { color:#adad93; }

.bypostauthor .comment-meta a, .bypostauthor .comment-meta a:visited { color:#adad93; }

Page 155: How to Prepare a WordPress Theme for Public Release

Comment by post author classes

WORDPRESS-GENERATED CSS CLASSES

Page 156: How to Prepare a WordPress Theme for Public Release

Theme is required to include, at a minimum:

• index.php• comments.php• screenshot.png• style.css

THEME TEMPLATE FILES

Page 157: How to Prepare a WordPress Theme for Public Release

Theme is recommended to include:

• 404.php• archive.php• footer.php• header.php• page.php• search.php• sidebar.php• single.php

THEME TEMPLATE FILES

Page 158: How to Prepare a WordPress Theme for Public Release

Theme may optionally include:

• attachment.php• author.php• category.php• date.php• editor-style.css• image.php• tag.php

THEME TEMPLATE FILES

Page 159: How to Prepare a WordPress Theme for Public Release

Submitted theme are recommended not to include files named like the following.

• page-foobar.php• category-foobar.php• tag-foobar.php• taxonomy-foobar.php

THEME TEMPLATE FILES

Page 160: How to Prepare a WordPress Theme for Public Release

Themes are recommended to use core markup for the following forms, using the indicated template tag:

• Login Form — wp_login_form()

• Search Form — wp_search_form()

THEME TEMPLATE FILES

Page 161: How to Prepare a WordPress Theme for Public Release

Themes are recommended to use core markup for the following forms, using the indicated template tag:

• Login Form — wp_login_form()

• Search Form — wp_search_form()

THEME TEMPLATE FILES

searchform.php

Page 162: How to Prepare a WordPress Theme for Public Release

Themes are required to be 100% GPL-licensed, or use a GPL-compatible license. This includes all PHP, HTML, CSS, images, fonts, icons, and everything else.

All of the theme must be GPL-Compatible.

LICENSING

Page 163: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

THEME NAME

Page 164: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

• Don’t use “WordPress” in the name

THEME NAME

Page 165: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

• Don’t use “WordPress” in the name

• Don’t use “Theme” in the name

THEME NAME

Page 166: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

• Don’t use “WordPress” in the name

• Don’t use “Theme” in the name

• Don’t use HTML or CSS or any other version-specific, markup-related term

THEME NAME

Page 167: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

• Don’t use “WordPress” in the name

• Don’t use “Theme” in the name

• Don’t use HTML or CSS or any other version-specific, markup-related term

• Don’t credit yourself in the name.

THEME NAME

Page 168: How to Prepare a WordPress Theme for Public Release

Theme Name Guidelines are required for new Themes, and recommended for existing Themes.

• Don’t use “WordPress” in the name

• Don’t use “Theme” in the name

• Don’t use HTML or CSS or any other version-specific, markup-related term

• Don’t credit yourself in the name.

• Feel free to use the WP in the name.

THEME NAME

Page 169: How to Prepare a WordPress Theme for Public Release

Themes may optionally designate Author URI and Theme URI in style.css.

CREDIT LINKS

Themes may optionally include a public-facing credit link in the Theme footer.

Themes may optionally include a Theme Option to display additional credit links or text.

BOOKMARKhttp://themeshaper.com/sample-theme-options/

Page 170: How to Prepare a WordPress Theme for Public Release

Please be clear about the following in your Theme documentation.

1. Indicate what the theme will do.

2. Adhere to the standard naming conventions.

3. Indicate deficiencies, if any.

4. Clearly reference anything out of the ordinary with comments in the code.

5. If you have any special requirements indicate these explicitly.

6. Provide contact information, if possible, for support and questions.

THEME DOCUMENTATION

Page 171: How to Prepare a WordPress Theme for Public Release

The Theme must meet all the requirements of the Theme Unit Test.

THEME UNIT TESTS

Referenced in the beginning ofthe “Build” section.

Page 172: How to Prepare a WordPress Theme for Public Release
Page 173: How to Prepare a WordPress Theme for Public Release
Page 174: How to Prepare a WordPress Theme for Public Release
Page 175: How to Prepare a WordPress Theme for Public Release
Page 176: How to Prepare a WordPress Theme for Public Release

Themes must be kept current once submitted, approved, and accepted into the Theme Repository.

THEME OBSOLESCENCE

Page 177: How to Prepare a WordPress Theme for Public Release

RELEASERELEASE

Page 178: How to Prepare a WordPress Theme for Public Release

RELEASERELEASE

Page 179: How to Prepare a WordPress Theme for Public Release

RELEASERELEASE

Page 180: How to Prepare a WordPress Theme for Public Release

PLATFORMRELEASERELEASE

Page 181: How to Prepare a WordPress Theme for Public Release

RELEASERELEASE

Page 182: How to Prepare a WordPress Theme for Public Release

SUPPORTSUPPORT

Page 183: How to Prepare a WordPress Theme for Public Release

SUPPORTRoll your own…

SUPPORT

Page 184: How to Prepare a WordPress Theme for Public Release

SUPPORTSUPPORT

Page 185: How to Prepare a WordPress Theme for Public Release

SUPPORTSUPPORT

Page 186: How to Prepare a WordPress Theme for Public Release

SUPPORTPick your poison… ;)

SUPPORT

Page 187: How to Prepare a WordPress Theme for Public Release

FRO

MTH

EW

AYS

TO STA

ND

OU

TCR

OW

D

Page 188: How to Prepare a WordPress Theme for Public Release

THEMES THEMES THEMESTHEMES THEMES THEMESTHEMESASPLUGINSTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMES

Page 189: How to Prepare a WordPress Theme for Public Release
Page 190: How to Prepare a WordPress Theme for Public Release

iPad

Page 191: How to Prepare a WordPress Theme for Public Release

Kindle

Page 192: How to Prepare a WordPress Theme for Public Release
Page 193: How to Prepare a WordPress Theme for Public Release

Photo credit: http://www.fastcodesign.com/1662356/ideo-creates-three-visions-for-books-in-the-digital-age

Page 194: How to Prepare a WordPress Theme for Public Release

Photo credit: http://www.flickr.com/photos/elwillo/4258135741/

Page 195: How to Prepare a WordPress Theme for Public Release

Photo credit: http://www.fastcodesign.com/1662197/how-augmented-reality-windshields-could-transform-driving

Page 196: How to Prepare a WordPress Theme for Public Release

THEMES THEMES THEMESTHEMES THEMES THEMESTHEMESASAPPLICATIONSTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMES

Page 197: How to Prepare a WordPress Theme for Public Release

TraditionalAUDIENCE

Page 198: How to Prepare a WordPress Theme for Public Release

ApplicationACTIVITY

Page 199: How to Prepare a WordPress Theme for Public Release

DESIGN +Custom content types

Page 200: How to Prepare a WordPress Theme for Public Release

THEMES THEMES THEMESTHEMES THEMES THEMESTHEMESBEYONDWORDPRESSTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMESTHEMES THEMES THEMES

Page 201: How to Prepare a WordPress Theme for Public Release
Page 202: How to Prepare a WordPress Theme for Public Release
Page 203: How to Prepare a WordPress Theme for Public Release
Page 204: How to Prepare a WordPress Theme for Public Release

THANK YOU

— ! —twitter: @davidyeiser

the web: designintellection.com