The Loop

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites & 3 Groups

    The Loop - Presentation Transcript

    1. Doin’ da Loop with da WordPrez Gary Barber radharc.com.au manwithnoblog.com
    2. I’m Assuming • You know what WordPress is and you have used it.
    3. I’m Assuming • You know what WordPress is and you have used it. • You know that you can use plugins and widgets
    4. 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
    5. 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
    6. 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
    7. 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
    8. ...Boring...So Get on With It....
    9. What is the Loop • It’s the core of WordPress
    10. What is the Loop • It’s the core of WordPress • It’s a heap of PHP code over different files that works together
    11. 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
    12. So where is the Loop • WordPress uses one central control point
    13. So where is the Loop • WordPress uses one central control point • All requests go via this file - index.php
    14. 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
    15. 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
    16. 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 ....
    17. 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
    18. 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(); ?>
    19. How does it work The Loop is really very basic Show the Page Header <?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(); ?>
    20. How does it work The Loop is really very basic Show the Page Header <?php get_header(); ?> <?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?> Do the Loop! <?php the_content();?> <?php endwhile; ?> <?php endif; ?> <?php get_sidebar();?> <?php get_footer(); ?>
    21. How does it work The Loop is really very basic Show the Page Header <?php get_header(); ?> <?php if (have_posts()) ?> <?php while (have_posts()) ?> <?php the_post();?> Do the Loop! <?php the_content();?> <?php endwhile; ?> <?php endif; ?> Show the Page Footer & <?php get_sidebar();?> <?php get_footer(); ?> Side Bar
    22. In Detail • Section One - <?php if (have_posts()) ?> checks information <?php while (have_posts()) ?> <?php the_post();?> <?php the_content();?> <?php endwhile; ?> <?php endif; ?>
    23. In Detail • Section One - <?php if (have_posts()) ?> checks information • Section Two - gets <?php while (have_posts()) ?> the posts, and <?php the_post();?> more information <?php the_content();?> <?php endwhile; ?> <?php endif; ?>
    24. In Detail • Section One - <?php if (have_posts()) ?> checks information • Section Two - gets <?php while (have_posts()) ?> the posts, and <?php the_post();?> more information <?php the_content();?> • Section Three - <?php endwhile; ?> displays the posts and information <?php endif; ?>
    25. And a Little Closer • Check that there <?php if (have_posts()) ?> are posts <?php while (have_posts()) ?> <?php the_post();?> <?php the_content();?> <?php endwhile; ?> <?php endif; ?>
    26. And a Little Closer • Get information on <?php if (have_posts()) ?> the post along with secondary <?php while (have_posts()) ?> information like: <?php the_post();?> <?php the_content();?> Post Title <?php endwhile; ?> Publication Date Author <?php endif; ?> Categories
    27. And a Little Closer • Then WordPress <?php if (have_posts()) ?> displays the post with all its <?php while (have_posts()) ?> formatting <?php the_post();?> information on <?php the_content();?> your blog <?php endwhile; ?> <?php endif; ?>
    28. And a Little Closer • Then WordPress <?php if (have_posts()) ?> goes and checks for more posts and <?php while (have_posts()) ?> we start again. <?php the_post();?> <?php the_content();?> <?php endwhile; ?> <?php endif; ?>
    29. 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(); ?>
    30. 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(); ?>
    31. 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(); ?>
    32. 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(); ?>
    33. 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(); ?>
    34. 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(); ?>
    35. 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(); ?>
    36. 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(); ?>
    37. 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(); ?>
    38. 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(); ?>
    39. 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(); ?>
    40. 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(); ?>
    41. 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(); ?>
    42. 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(); ?>
    43. 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(); ?>
    44. 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(); ?>
    45. 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(); ?>
    46. ...So when does it get Interesting...
    47. The Loop is Breeding • The Loop is all through WordPress
    48. The Loop is Breeding • The Loop is all through WordPress • In the Archive Template
    49. The Loop is Breeding • The Loop is all through WordPress • In the Archive Template • In the Search Template
    50. 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
    51. Customise the Loop • Change Archive and Search pages to display excerpt
    52. Customise the Loop • Change Archive and Search pages to display excerpt • Customise the CSS for different times, dates, categories, authors days of the week
    53. 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
    54. 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
    55. 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
    56. 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
    57. Customising Demo
    58. Thankyou • • wordpress.org drpritch • • mattread.com pierre pouliquin • ifelse.co.uk • Pennance368 • fensterbme • fotopeet • gerardvschip • Niklas Distributed under Creative Commons License Gary Barber gary@manwithnoblog.com radharc.com.au manwithnoblog.com

    + Gary BarberGary Barber, 3 years ago

    custom

    10018 views, 3 favs, 4 embeds more stats

    Introductory presentation on the Wordpress Loop

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 10018
      • 9993 on SlideShare
      • 25 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 89
    Most viewed embeds
    • 22 views on http://manwithnoblog.com
    • 1 views on http://localhost
    • 1 views on http://lesliefranke.com
    • 1 views on http://static.slideshare.net

    more

    All embeds
    • 22 views on http://manwithnoblog.com
    • 1 views on http://localhost
    • 1 views on http://lesliefranke.com
    • 1 views on http://static.slideshare.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events