build a responsive wordpress theme with zurbs foundation framework

44
WordCamp Montreal 2013 Build a Responsive WordPress Theme with ZURBs Foundation 4 Framework.

Upload: brendan-sera-shriar

Post on 13-Jan-2015

13.838 views

Category:

Technology


2 download

DESCRIPTION

Responsive design is becoming an expected standard for web developers. Your website or blog needs to look good and function on all screens and devices all the time, and just choosing a “responsive” WordPress theme isn’t always the best choice. In this session you’ll learn how easy it is to integrate foundation.css into your WordPress theme and how to get added functionality from their jQuery and zepto libraries. We’ll also dive into the css to understand how “responsivity” works.

TRANSCRIPT

Page 2: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Before we can code responsively,

we must understand the fundamentals.

Page 3: Build a Responsive WordPress Theme with Zurbs Foundation Framework

What the heck is responsive web design?

Page 4: Build a Responsive WordPress Theme with Zurbs Foundation Framework

A website or app that responds to the device that accesses it and delivers the

appropriate output for it.

Page 5: Build a Responsive WordPress Theme with Zurbs Foundation Framework

No pinch and zoom!

Page 6: Build a Responsive WordPress Theme with Zurbs Foundation Framework

One Site to Rule

Them ALL!

Cheesy movie reference :)

Page 7: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Why build responsively?

Page 8: Build a Responsive WordPress Theme with Zurbs Foundation Framework

“Day by day, the number of devices, platforms, and browsers that need to work with your site grows. Responsive web design represents a fundamental shift in how we’ll build websites for the decade to come.”

- Jeffrey VeenJeffrey Veen is the author of "The Art and Science of Web Design"

Page 9: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Some basic stats ...because I’m a marketing guy :)

Page 10: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Smartphone sales have become bigger

than PC sales.

Page 11: Build a Responsive WordPress Theme with Zurbs Foundation Framework

28% of Internet usage comes from a

mobile phone

Page 12: Build a Responsive WordPress Theme with Zurbs Foundation Framework

In the retail industry, 16% of search queries

come from mobile web usage

Page 13: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Mobile web usage took 50% of sales

related to Mother’s Day in 2012

Page 14: Build a Responsive WordPress Theme with Zurbs Foundation Framework

There were a total of $163 billion mobile

transactions in 2012

$235.4 billion expected in 2013

Page 15: Build a Responsive WordPress Theme with Zurbs Foundation Framework

We must build responsively,

the web depends on it!

Page 16: Build a Responsive WordPress Theme with Zurbs Foundation Framework

The basics of responsive web design

Page 17: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Before you wireframe, design, or code ...

Think mobile first!

Page 18: Build a Responsive WordPress Theme with Zurbs Foundation Framework

consider ...

1

2

3

4

5

Page 19: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Use a responsive framework

We use Foundation 4 by ZURB

Page 20: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Why we chose Foundation 4

★ Designed for Mobile First!

★ Flexible 12-column grid

★ Mobile visibility elements

★ Mobile navigation - toggle or off-canvas

★ Existing WP theme

★ Powerful jQuery and Zepto libraries

★ Foundation is developed in Sass

Page 21: Build a Responsive WordPress Theme with Zurbs Foundation Framework

It’s all about the grids!

Page 22: Build a Responsive WordPress Theme with Zurbs Foundation Framework

What you need to consider in the design phase

Image sizing

Page 23: Build a Responsive WordPress Theme with Zurbs Foundation Framework

What you need to consider in the design phase

Stacking & Re-ordering of columns

Page 24: Build a Responsive WordPress Theme with Zurbs Foundation Framework

What you need to consider in the design phase

Mobile Navigation

Page 25: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Design for mobile navigation

Toggle menu Off-canvas menuvs.

Page 26: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Responsive Navigation: Optimizing for Touch Across Devices

Adapting

Common Patterns

Read: Responsive Navigation: Optimizing for Touch Across Devices by Luke Wroblewski

Page 27: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Now that we covered the basics,

let’s look at the code ...

Page 29: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Markup

<meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>Foundation 4</title>

<link rel="stylesheet" href="css/normalize.css" /> <link rel="stylesheet" href="css/foundation.css" />

<link rel="stylesheet" href="css/app.css" />

<script src="js/vendor/custom.modernizr.js"></script>

<head> (css version)

Page 30: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Markup

<script> document.write('<script src=' + ('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') + '.js><\/script>')</script><script src="js/foundation/foundation.js"></script><script src="js/foundation/foundation.LIB-YOU-NEED.js"></script> <script> $(document).foundation(); </script>

Before </body>

Page 31: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Libraries

What comes with Foundation 4

★ Forms

★ Navigation

★ Reveal

★ Joyride

★ Magellan

★ Orbit

★ Tooltips

To name a few ...

Page 32: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Let’s do it!

Page 33: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Grid

<div class=“row”><div class=“large-12 columns”>

</div></div>

<!-- stuff -->

The Grid in Action

Super Easy!

Page 34: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Grid

Customizing the Grid

Page 35: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Grid

Customizing the Grid

Page 36: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Grid

Customizing the Grid

Page 37: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Grid

Customizing the Grid

Page 38: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Foundation 4 Markup in WP<?php get_header(); ?>

<div class=“row”> <div class="large-6 columns" role="main"> <?php while (have_posts()) : the_post(); ?> <article <?php post_class() ?> id="post-<?php the_ID(); ?>"> <header> <h1 class="entry-title"><?php the_title(); ?></h1> <?php reverie_entry_meta(); ?> </header> <div class="entry-content"> <?php the_content(); ?> </div> </article> <?php endwhile;?> </div>

</div> <?php get_sidebar(); ?><?php get_footer(); ?>

That was Easy!

The other large-6 is in sidebar.php

Page 39: Build a Responsive WordPress Theme with Zurbs Foundation Framework

If it ain’t broke don’t fix it!

Get Reverie by ThemeFortress

Page 40: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Easy to hack

Most stable Foundation WP theme

Only F4 Theme!

It’s FREE

Page 41: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Some Examples

Page 42: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Some Examples

Page 43: Build a Responsive WordPress Theme with Zurbs Foundation Framework

Some Examples