Transcript Slide 1

HTML5 + WordPress

Rob Larsen 1.23.2010

htmlcssjavascript.com | drunkenfist.com

@robreact htmlcssjavascript.com /downloads/wordpress.ppt

Who is this Guy Anyway?

• 12+ years HTML/CSS/JavaScript. My job since 1999. • WordPress since 2005. Launched a ton of sites. Currently manage 6.

• For the next 5 days: Principal Presentation Engineer at Cramer

• Next Week: Molecular

PAST: AdvisorTech, Compete, Demandware, The Weekly Dig, Gillette, Museum of Science, Boston, PC Connection, State Street, Webex

Introduction to HTML5

HTML5 is a lot of things – Ongoing. This is a moving target. The spec can change underneath you. This can be fun, I swear. It also means there’s not always an

answer.

That, too, can be fun.

– Occasionally controversial. – Full of cool stuff that’s got both browser and web developers excited – Something to pay attention to/ experiment with/ discuss and give feedback on (which is why we’re here today)

What Are We Going To Talk About

Marking up a standard WordPress blog using some of the new, semantic elements/attributes. This is a subset of the spec that’s relatively stable and is usable right now. We’ll use a small bit of JavaScript or the Modernizr library to make styling these elements work in Internet Explorer.

Sweet.

Meet the New Semantic Elements

The section element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading. Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site's home page could be split

into

sections for an introduction, news items, contact information.

Meet the New Semantic Elements

The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links. Not all groups of links on a page need to be in a nav element — only sections that consist of major navigation blocks are appropriate for the nav element. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases, without a nav element

Meet the New Semantic Elements

The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

Meet the New Semantic Elements

The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography. The element can be used for typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other content that is considered separate from the main content of the page.

Meet the New Semantic Elements

The hgroup element represents the heading of a section. The element is used to group a set of h1 –h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.

“Just another wordpress weblog”

Meet the New Semantic Elements

The header element represents a group of introductory or navigational aids. A header element is intended to usually contain the section’s heading (an h1–h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section’s table of contents, a search form, or any relevant logos.

Meet the New Semantic Elements

The footer element represents a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like. Footers don’t necessarily have to appear at the end of a section, though they usually do. When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.

Meet the New Semantic Elements

The time element represents either a time on a 24 hour clock, or a precise date in the proleptic Gregorian calendar, optionally with a time and a time-zone offset.

Meet the New Semantic Elements
attributes Placeholder Text/Search Boxes

Email Addresses

Web Addresses

Isn’t All That New Stuff Just About Perfect for Marking up a Blog?

Heck yes.

Let’s Look at Some Code

header.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ ?> > <?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?> Default/Kubrick (part 1)

header.php

>


Default/Kubrick (part 2)

header.php

class=“no-js”> <?php if ( is_front_page() ) {bloginfo('name');?> | Fresh Ideas Caught and Served <?php } else {;?> <?php bloginfo('name');?> | <?php if($post->post_parent) { $parent_title = get_the_title($post->post_parent); echo $parent_title;?> – echo get_post_meta($post->ID, "meta-description", "true"); ?>" /> var ___baseURL =""; /_assets/scripts/b.c.js"> AwiderNet.com

View Source

A Wider Net | Fresh Ideas Caught and Served AwiderNet.com

index.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ get_header(); ?>

id="post-">

?>

Default/Kubrick

View Source

s

Default/Kubrick

sidebar.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ ?>

Default/Kubrick

searchform.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ ?>

Default/Kubrick

comments.php

// snip!

?>

You must be logged in to post a comment.

Logged in as . Log out »

/>

/>

< input type="url" class="text-input" name="url" id="url" value="" size="22" tabindex="3" />

ID); ?>

 AWiderNet

footer.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ ?>


Default/Kubrick

footer.php

What’s the Diff?

archives.php

/** * @package WordPress * @subpackage Kubrick_x_HTML5 */ /* Template Name: Archives */ ?>

Archives by Month:

Archives by Subject:

Kubrick/default

/*SNIP!*/ /* Begin Structure */ body { margin: 0 0 20px 0; padding: 0; } /*HTML5*/ footer, section, article, aside, header, time { display:block; } #page { background-color: white; margin: 20px auto; padding: 0; width: 760px; border: 1px solid #959596; } #header /*SNIP!*/

style.css

Kubrick/default

style.css

What’s the Diff?

style.css

.borderradius.boxshadow.rgba #container #main article, .borderradius.boxshadow.rgba #container #main #posts > .meta-data, .borderradius.boxshadow.rgba #container #main #posts #no-results, .borderradius.boxshadow.rgba #container #main #posts .author { border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, .15); box-shadow: 0px 0px 5px rgba(0, 0, 0, .15); -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, .15); background:#fff; overflow: hidden; }

AWiderNet

PSST! CSS3

Things I Learned The new outline algorithm is a fickle master Otherwise- not so bad.

Kubrick worked with almost no browser specific intervention in modern browsers

Any Questions?

More Info • • • • • http://www.whatwg.org/ http://diveintohtml5.org/ http://www.modernizr.com/ http://gsnedders.html5.org/outliner/ http://htmlcssjavascript.com/html/im messing-around-with-an-html5-version-of the-default-wordpress-theme/