the loop

65
Doin’ da Loop with da WordPrez Gary Barber radharc.com.au manwithnoblog.com

Upload: gary-barber

Post on 01-Sep-2014

14.550 views

Category:

Technology


3 download

DESCRIPTION

Introductory presentation on the Wordpress Loop

TRANSCRIPT

Page 1: The Loop

Doin’ da Loopwith da WordPrez

Gary Barberradharc.com.au

manwithnoblog.com

Page 2: The Loop

I’m Assuming• You know what WordPress is and you have used it.

Page 3: The Loop

I’m Assuming• You know what WordPress is and you have used it.

• You know that you can use plugins and widgets

Page 4: The Loop

I’m Assuming• You know what WordPress is and you have used it.

• You know that you can use plugins and widgets

• Your blog is not on wordpress.com

Page 5: The Loop

I’m Assuming• You know what WordPress is and you have used it.

• You know that you can use plugins and widgets

• Your blog is not on wordpress.com

• You know what PHP is

Page 6: The Loop

I’m Assuming• You know what WordPress is and you have used it.

• You know that you can use plugins and widgets

• Your blog is not on wordpress.com

• You know what PHP is

• You are not happy coding

Page 7: The Loop

I’m Assuming• You know what WordPress is and you have used it.

• You know that you can use plugins and widgets

• Your blog is not on wordpress.com

• You know what PHP is

• You are not happy coding

• You have never pulled the templates apart

Page 8: The Loop

...Boring...So Get on With It....

Page 9: The Loop

What is the Loop• It’s the core of WordPress

Page 10: The Loop

What is the Loop• It’s the core of WordPress

• It’s a heap of PHP code over different files that works together

Page 11: The Loop

What is the Loop• It’s the core of WordPress

• It’s a heap of PHP code over different files that works together

• Lets you display your posts, comments and the rest of your blog

Page 12: The Loop
Page 13: The Loop

So where is the Loop• WordPress uses one

central control point

Page 14: The Loop

So where is the Loop• WordPress uses one

central control point

• All requests go via this file - index.php

Page 15: The Loop

So where is the Loop• WordPress uses one

central control point

• All requests go via this file - index.php

• It’s your themes central control

Page 16: The Loop

So where is the Loop• WordPress uses one

central control point

• All requests go via this file - index.php

• It’s your themes central control

• Remove it you get the default theme

Page 17: The Loop

So where is the Loop• WordPress uses one

central control point

• All requests go via the file - index.php

• It’s your themes central control

• Remove it you get the default theme

• Remove that ....

Page 18: The Loop
Page 19: The Loop

So where is the Loop• WordPress uses one

central control point

• All requests go via the file - index.php

• It’s your themes central control

• Remove it you get the default theme

• Remove that and you get nothing

Page 20: The Loop

How does it work The Loop is really very basic

<?php get_header(); ?>

<?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?><?php the_content();?> <?php endwhile; ?>

<?php endif; ?>

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

Page 21: The Loop

How does it work The Loop is really very basic

<?php get_header(); ?>

<?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?><?php the_content();?> <?php endwhile; ?>

<?php endif; ?>

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

Show the Page Header

Page 22: The Loop

How does it work The Loop is really very basic

Show the Page Header

Do the Loop!

<?php get_header(); ?>

<?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?><?php the_content();?> <?php endwhile; ?>

<?php endif; ?>

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

Page 23: The Loop

How does it work The Loop is really very basic

<?php get_header(); ?>

<?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?><?php the_content();?> <?php endwhile; ?>

<?php endif; ?>

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

Show the Page Header

Do the Loop!

Show the Page Footer & Side Bar

Page 24: The Loop

In Detail <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Section One - checks information

Page 25: The Loop
Page 26: The Loop
Page 27: The Loop
Page 28: The Loop

In Detail <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Section One - checks information

• Section Two - gets the posts, and more information

Page 29: The Loop
Page 30: The Loop

In Detail <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Section One - checks information

• Section Two - gets the posts, and more information

• Section Three - displays the posts and information

Page 31: The Loop
Page 32: The Loop

And a Little Closer <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Check that there are posts

Page 33: The Loop

And a Little Closer <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Get information on the post along with secondary information like:

Post TitlePublication DateAuthorCategories

Page 34: The Loop

And a Little Closer <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Then WordPress displays the post with all its formatting information on your blog

Page 35: The Loop

And a Little Closer <?php if (have_posts()) ?>

<?php while (have_posts()) ?>

<?php the_post();?>

<?php the_content();?>

<?php endwhile; ?>

<?php endif; ?>

• Then WordPress goes and checks for more posts and we start again.

Page 36: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 37: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 38: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 39: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 40: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 41: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 42: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 43: The Loop

Some Examples - Default<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 44: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 45: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 46: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 47: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 48: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 49: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 50: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 51: The Loop

Items to Note<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 52: The Loop

Life After the Loop<?php get_header(); ?><div id="content" class="narrowcolumn"><?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to

<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div><?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?></div><?php get_sidebar(); ?><?php get_footer(); ?>

Page 53: The Loop

...So when does it get Interesting...

Page 54: The Loop

The Loop is Breeding• The Loop is all through

WordPress

Page 55: The Loop

The Loop is Breeding• The Loop is all through

WordPress

• In the Archive Template

Page 56: The Loop

The Loop is Breeding• The Loop is all through

WordPress

• In the Archive Template

• In the Search Template

Page 57: The Loop

The Loop is Breeding• The Loop is all through

WordPress

• In the Archive Template

• In the Search Template

• It’s even used for the generation of the comments

Page 58: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

Page 59: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

• Customise the CSS for different times, dates, categories, authors days of the week

Page 60: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

• Customise the CSS for different times, dates, categories, authors days of the week

• Change your home page to a static one

Page 61: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

• Customise the CSS for different times, dates, categories, authors days of the week

• Change your home page to a static one

• Place items between blog posts

Page 62: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

• Customise the CSS for different times, dates, categories, authors days of the week

• Change your home page to a static one

• Place items between blog posts

• Add a Lemon

Page 63: The Loop

Customise the Loop• Change Archive and Search pages to display excerpt

• Customise the CSS for different times, dates, categories, authors days of the week

• Change your home page to a static one

• Place items between blog posts

• Add a Lemon

• But check for Plugins or Widgets first

Page 64: The Loop

Customising Demo

Page 65: The Loop

Thankyou• wordpress.org• mattread.com• ifelse.co.uk• Pennance368• fensterbme • fotopeet• gerardvschip• Niklas

• drpritch• pierre pouliquin

Distributed under Creative Commons License

Gary [email protected]

radharc.com.aumanwithnoblog.com