various ways of using wordpress

36
VARIOUS WAYS OF USING WordPress BY: NICK LA www.ndesign-studio.com Customizing

Upload: nick-la

Post on 27-Jan-2015

104 views

Category:

Design


0 download

DESCRIPTION

Presentation slides for WordCamp Toronto 2009 by Nick La, www.ndesign-studio.com.

TRANSCRIPT

Page 1: Various Ways of Using WordPress

VARIOUS WAYS OF USING

WordPress

BY: NICK LA

www.ndesign-studio.com

Customizing

Page 2: Various Ways of Using WordPress

Big Thanks to WordPress!

N.Design Studiondesign-studio.com

Web Designer Wallwebdesignerwall.com

Best Web Gallerybestwebgallery.com

IconDockicondock.com

Page 3: Various Ways of Using WordPress

Why WordPress?

• Easy to learn & useGood documentation and simple admin panel

• Flexible and dynamicCreate dynamic sites with Template Tags

• SEO friendlyFriendly URL and semantic coding

• FREE!Free open source + plugins and themes

Page 4: Various Ways of Using WordPress

Things You Should Know

• Custom Fieldshttp://codex.wordpress.org/Using_Custom_Fields

• Conditional Tagshttp://codex.wordpress.org/Conditional_Tags

• Query_Postshttp://codex.wordpress.org/Template_Tags/query_posts

• Page Templatehttp://codex.wordpress.org/Pages

• Finding Good Pluginshttp://wordpress.org/extend/plugins

Page 5: Various Ways of Using WordPress

How I Use WordPress:

Blog Gallery Shop

webdesignerwall.com bestwebgallery.com icondock.com

Page 6: Various Ways of Using WordPress

Using WordPress As

Blog

Page 7: Various Ways of Using WordPress

Displaying A Custom Post Image

Page 8: Various Ways of Using WordPress

Custom Fields

Custom field

Use custom field to display a post image

Page 9: Various Ways of Using WordPress

Custom Fields

Custom field Image URL

Assigning custom field (Admin > Write)

Page 10: Various Ways of Using WordPress

Custom Fields

<?php $postimage = get_post_meta($post->ID, 'post_image', true); ?>

<?php if ($postimage != "") { ?> <a href="<?php the_permalink() ?>"><img src="<?php echo $postimage; ?>" /></a><?php } ?>

index.php

Outputting custom field in template file

Page 11: Various Ways of Using WordPress

Displaying A Dynamic <title> Tag

Page 12: Various Ways of Using WordPress

Conditional Tags

<title> <?php if (is_home()) { echo bloginfo('name'); } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; wp_title(''); } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; wp_title(''); } else { echo wp_title(''); } ?></title>

header.php

Use Conditional Tags to display a dynamic <title> tag

Page 13: Various Ways of Using WordPress

Using WordPress As

Gallery

Page 14: Various Ways of Using WordPress

Managing Posts With Custom Fields

Page 15: Various Ways of Using WordPress

Custom Fields

Large Image

URL

Thumb

Use custom fields to display post content

Page 16: Various Ways of Using WordPress

Plugin: Custom Write Panel

Custom Write Panelhttp://wordpress.org/extend/plugins/custom-write-panel/

Save time by using Custom Write Panel plugin to manage posts

Page 17: Various Ways of Using WordPress

Theme Switcher

Page 18: Various Ways of Using WordPress

Plugin: Theme Switcher

Theme Switcherhttp://wordpress.org/extend/plugins/theme-switcher/

Thumbnail Large Preview Details

With Theme Switcher, visitors can pick their layout preference

Page 19: Various Ways of Using WordPress

ThemesOverview of template files

Page 20: Various Ways of Using WordPress

PHP Include

<?php if (is_page()) { include ('./wp-content/themes/master/page.php');} elseif (is_404()) { include ('./wp-content/themes/master/404.php');} elseif (in_category(8)) { include ('./wp-content/themes/master/category-8.php');} elseif (is_single()) { include ('./wp-content/themes/master/single.php');} else {?>

<?php include ('./wp-content/themes/master/header.php'); ?> <div>. . . display posts . . . </div> <?php include ('./wp-content/themes/master/sidebar.php'); ?> <?php include ('./wp-content/themes/master/footer.php'); ?> <?php }?>

Use Conditional Tags to dynamically include template file from the “master” theme

/* Theme Name: Details*/

Page 21: Various Ways of Using WordPress

Using WordPress As

Shop / Blog

Page 22: Various Ways of Using WordPress

Displaying The 5 Latest Posts

Page 23: Various Ways of Using WordPress

Query_Posts

Display 5 latest posts

Use query_posts to display the 5 latest posts

Page 24: Various Ways of Using WordPress

Query_Posts

<?php query_posts('showposts=5'); ?>

<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); $loopcounter++; ?> <?php if ($loopcounter <= 1) { ?> <div> first post content </div> <ul class="recent-post"> <?php } else { ?> <li> last 4 post links </li> <? } ?><?php endwhile;?> </ul><?php else : ?> ...code...<?php endif; ?>

index.php

Sample code: query_posts and the loop

Page 25: Various Ways of Using WordPress

Conditional Tags

<?php if (in_category('28')) { ?> <p>credits</p> <?php if(function_exists('the_ratings')) { the_ratings(); } ?><?php } else { ?> <p>regular post data</p><? } ?>

If the post is in the free icon category, display the post rating plugin

Page 26: Various Ways of Using WordPress

Managing Free Icon Posts With Custom Fields

Page 27: Various Ways of Using WordPress

Custom Fields

download url

WP PostRatingshttp://wordpress.org/extend/plugins/wp-postratings/

preview

description

credits

Custom fields on the free icon page

Page 28: Various Ways of Using WordPress

Plugin: Flutter

Flutter http://flutter.freshout.us

Use Flutter to manage the free icon posts

Page 29: Various Ways of Using WordPress

Getting Rid Of The Category Base

Page 30: Various Ways of Using WordPress

Free Icon TemplateCreating a Page template for the free icon page

<?php/*Template Name: Template - Free Icons*/?>

<?php get_header(); ?>

<?php $page_num = $paged;if ($pagenum='') $pagenum =1;query_posts('cat=28&posts_per_page=-1&paged='.$page_num); ?>

<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> <div> display post here </div> <? endwhile;endif; ?>

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

template-free-icon.php

Page 31: Various Ways of Using WordPress

Free Icon TemplateCreate a blank page (Free Icons) and assign the template

blank page (no content)

Page template

Page 32: Various Ways of Using WordPress

Creating A Shop With WP ECommerce Plugin

Page 33: Various Ways of Using WordPress

Download WP eCommercehttp://www.instinct.co.nz/e-commerce/

Page 34: Various Ways of Using WordPress

Inspiration

Page 35: Various Ways of Using WordPress

45Royale Inc.http://www.45royale.com

Creative Departhttp://www.creativedepart.com

Typographicahttp://new.typographica.org

FlickOuthttp://flickout.com

Jeff Finleyhttp://www.jefffinley.org

Page 36: Various Ways of Using WordPress

Thank You