47

Making WordPress Your Own: Theme Customization & Creation

Embed Size (px)

DESCRIPTION

You can put your own stamp on virtually any theme. You just need a basic understanding what how WordPress works. This session will explore the basic functions and templates that make WordPress tick. Then you'll get your hands dirty by customizing a number of popular free and premium themes. Wanna go all the way? We'll also discuss the steps to create your own theme from scratch. Presented at the first WordCamp Minneapolis/St. Paul (wordcampmsp).

Citation preview

Page 1: Making WordPress Your Own: Theme Customization & Creation
Page 2: Making WordPress Your Own: Theme Customization & Creation
Page 3: Making WordPress Your Own: Theme Customization & Creation
Page 4: Making WordPress Your Own: Theme Customization & Creation
Page 5: Making WordPress Your Own: Theme Customization & Creation
Page 6: Making WordPress Your Own: Theme Customization & Creation

Templates

• WordPress uses only a few basic templates

• This means less places to make changes that affect the whole site

• A handful of simple changes can make a big difference

Page 7: Making WordPress Your Own: Theme Customization & Creation

Meet the templates

header.php

index.php

sidebar.php

footer.php

archive.php

single.php

comments.php

page.php

search.php

404.php

Page 8: Making WordPress Your Own: Theme Customization & Creation
Page 9: Making WordPress Your Own: Theme Customization & Creation

Themes mainly powered by

• style.css

• functions.php

Page 10: Making WordPress Your Own: Theme Customization & Creation
Page 11: Making WordPress Your Own: Theme Customization & Creation
Page 12: Making WordPress Your Own: Theme Customization & Creation
Page 13: Making WordPress Your Own: Theme Customization & Creation

PSA: Our friend the style sheet

• Cascading style sheets (CSS) are not to be feared

• Simple, text-based instructionsin a specific format

• Follow the format and make your dreams come true

Page 14: Making WordPress Your Own: Theme Customization & Creation

Typical CSS format#site-title { float: left; font-size: 30px; color: #515151; font-weight: bold; line-height: 36px; margin: 0 0 18px 0; width: 700px;}

Page 15: Making WordPress Your Own: Theme Customization & Creation

Small Changes/Big Impact

1. Header and footer

2. Background

3. Color scheme

4. Fonts

5. Plugin styles

Start with the low-hanging fruit

Page 16: Making WordPress Your Own: Theme Customization & Creation

1. Header• Change/remove title, description

• Add/change header image

Footer• add navigation/links

• Add/change background

Page 17: Making WordPress Your Own: Theme Customization & Creation

2. Background

• Change/add page background imagebody {background-color:#b0c4de;}

• Change/add page background colorbody {background-image:url('bgdesert.jpg');}

Page 18: Making WordPress Your Own: Theme Customization & Creation

Mystique example - before

Page 19: Making WordPress Your Own: Theme Customization & Creation

Mystique example - after

Page 20: Making WordPress Your Own: Theme Customization & Creation

Mystique example - changes

Page 21: Making WordPress Your Own: Theme Customization & Creation

3. Color Scheme

• Determine element colors and chance in the style sheet

• ColorZilla Plugin (FireFox) can helphttp://www.colorzilla.com/firefox/

Page 22: Making WordPress Your Own: Theme Customization & Creation

4. FontsBasic HTML font styles are easy to control via style sheet p, H1, H2, H3...

p { font-family:"Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Tahoma, sans-serif; font-size:1em; color:#000; }

Page 23: Making WordPress Your Own: Theme Customization & Creation

Web fonts/@fontface

Allows you to use virtually any font as a true text element. No longer limited by traditional browser-safe fonts (Arial, Verdana, Times, etc.)

http://kernest.com/ http://typekit.com/

Page 24: Making WordPress Your Own: Theme Customization & Creation

Web fonts/@fontfacehttp://code.google.com/webfonts

Page 25: Making WordPress Your Own: Theme Customization & Creation

Typical @fontface CSS code@font-face { font-family: 'Colaborate'; src: url('http://kernest.com/embed/colaborate-regular'), url('http://kernest.com/embed/colaborate- regular#colabreg') format('svg');}

#content h1 { color: #000; font-family: 'Colaborate', Geneva, 'Lucida Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; font-size:32px;}

Page 26: Making WordPress Your Own: Theme Customization & Creation

5. Plugin style hacks

• Don’t be afraid to dig into plugin stylesheets to makefurther customizations

Page 27: Making WordPress Your Own: Theme Customization & Creation

General CSS tweak tips

• Use Web Developer Toolbar (FireFox) or similar CSS identification tool

• Select the element you want to change

• Find that style in the CSS and change it

• Go slow and only change what you understand

• Save and preview often

Page 28: Making WordPress Your Own: Theme Customization & Creation

Functionality upgrades

1. Custom pages

2. Modifying the Loop

3. Adding sidebars

Going beyond the basics

Page 29: Making WordPress Your Own: Theme Customization & Creation

1. Custom pages

• Provides flexibility to change layout based on needs

<?php /* Template Name: Calendar */ ?>

Page 30: Making WordPress Your Own: Theme Customization & Creation

2. Modifying the Loop

• Change way posts appear on blog homepageindex.php, The loop starts here:<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

and ends here:<?php endwhile; else: ?><p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

Page 31: Making WordPress Your Own: Theme Customization & Creation

3. Adding sidebars

• Why? Added functionality

• How? 1. functions.php

<?php if ( function_exists ('register_sidebar')) { register_sidebar ('custom'); } ?>

2. Copy sidebar.php (sidebar2.php)

3. Call where needed <?php include ('sidebar-cat.php'); ?>

Page 32: Making WordPress Your Own: Theme Customization & Creation

3. Adding sidebars

• Why? Added functionality1. functions.php

<?php if ( function_exists ('register_sidebar')) { register_sidebar ('custom'); } ?>

2. Copy sidebar.php (sidebar2.php)

3. Call where needed <?php include ('sidebar-cat.php'); ?>

Page 33: Making WordPress Your Own: Theme Customization & Creation

Additional sidebar examples

Page 34: Making WordPress Your Own: Theme Customization & Creation

Additional sidebar examples

Page 35: Making WordPress Your Own: Theme Customization & Creation

Customization tips• Make changes in stages, easier

to go back/troubleshoot

• Keep a unaltered copy of the theme handy, just in case

• No matter how much you customize always credit the original theme designer

Page 37: Making WordPress Your Own: Theme Customization & Creation

Pro (paid) themes

• Thesishttp://diythemes.com

• Headwayhttp://headwaythemes.com

• Genesis Frameworkhttp://www.studiopress.com/themes/genesis

Page 38: Making WordPress Your Own: Theme Customization & Creation

Thesis site options

Page 39: Making WordPress Your Own: Theme Customization & Creation

Headway configuration

Page 40: Making WordPress Your Own: Theme Customization & Creation

Headway visual editor

Page 41: Making WordPress Your Own: Theme Customization & Creation

Make your own theme

• Use a blank theme or framework*

• Start from scratch :(

*Do this

Page 42: Making WordPress Your Own: Theme Customization & Creation

Blank themes• Thematic

http://themeshaper.com/thematic/

• WP Frameworkhttp://wpframework.com

• BLANK WordPress Themehttp://digwp.com/2010/02/blank-wordpress-theme/http://digwp.com/2009/07/free-html-5-wordpress-theme/ (HTML 5 version)

• Simon WordPress Blank Themehttp://simonwebdesign.com/simon-wordpress-framework-blank-theme/

• Whiteboard – A Lightweight WordPress Frameworkhttp://whiteboardframework.com/

Page 43: Making WordPress Your Own: Theme Customization & Creation

Blank themes

Page 44: Making WordPress Your Own: Theme Customization & Creation

Built on WP Framework

Page 45: Making WordPress Your Own: Theme Customization & Creation

Built on WP Framework

Page 47: Making WordPress Your Own: Theme Customization & Creation

Mykl Roventine designer of things myklroventine.com @myklroventine

Thankyou!