Doin’ da Loop
with da WordPrez


        Gary Barber
      radharc.com.au
    manwithnoblog.com
I’m Assuming
•   You know what WordPress is and you have used it.
I’m Assuming
•   You know what WordPress is and you have used it.

•   You know that you can use plugins and widgets
I’m Assuming
•   You know what WordPress is and you have used it.

•   You know that you can use plugins and widgets

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

•   You know that you can use plugins and widgets

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

•   You know that you can use plugins and widgets

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

•   You know that you can use plugins and widgets

•   ...
...Boring...So Get on With It....
What is the Loop
•   It’s the core of WordPress
What is the Loop
•   It’s the core of WordPress

•   It’s a heap of PHP code over different files that works
    together
What is the Loop
•   It’s the core of WordPress

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

...
So where is the Loop
•   WordPress uses one
    central control point
So where is the Loop
•   WordPress uses one
    central control point

•   All requests go via this file
    - index.php
So where is the Loop
•   WordPress uses one
    central control point

•   All requests go via this file
    - index.php

•...
So where is the Loop
•   WordPress uses one
    central control point

•   All requests go via this file
    - index.php

•...
So where is the Loop
•   WordPress uses one
    central control point

•   All requests go via the file
    - index.php

• ...
So where is the Loop
•   WordPress uses one
    central control point

•   All requests go via the file
    - index.php

• ...
How does it work
    The Loop is really very basic
<?php get_header(); ?>

<?php if (have_posts()) ?>

<?php   while (have...
How does it work
    The Loop is really very basic
                               Show the Page Header
<?php get_header();...
How does it work
    The Loop is really very basic
                               Show the Page Header
<?php get_header();...
How does it work
    The Loop is really very basic
                               Show the Page Header
<?php get_header();...
In Detail
                                  • Section One -
<?php if (have_posts()) ?>
                                   ...
In Detail
                                  • Section One -
<?php if (have_posts()) ?>
                                   ...
In Detail
                                  • Section One -
<?php if (have_posts()) ?>
                                   ...
And a Little Closer
                                  • Check that there
<?php if (have_posts()) ?>
                      ...
And a Little Closer
                                  • Get information on
<?php if (have_posts()) ?>
                    ...
And a Little Closer
                                  • Then WordPress
<?php if (have_posts()) ?>
                        ...
And a Little Closer
                                  • Then WordPress
<?php if (have_posts()) ?>
                        ...
Some Examples - Default
<?php get_header(); ?>
<div id=quot;contentquot; class=quot;narrowcolumnquot;>
<?php if (have_post...
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
The Loop
Upcoming SlideShare
Loading in …5
×

The Loop

11,485 views

Published on

Introductory presentation on the Wordpress Loop

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
11,485
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
112
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

The Loop

  1. 1. Doin’ da Loop with da WordPrez Gary Barber radharc.com.au manwithnoblog.com
  2. 2. I’m Assuming • You know what WordPress is and you have used it.
  3. 3. I’m Assuming • You know what WordPress is and you have used it. • You know that you can use plugins and widgets
  4. 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. 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. 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. 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. 8. ...Boring...So Get on With It....
  9. 9. What is the Loop • It’s the core of WordPress
  10. 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. 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. 12. So where is the Loop • WordPress uses one central control point
  13. 13. So where is the Loop • WordPress uses one central control point • All requests go via this file - index.php
  14. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 29. Some Examples - Default <?php get_header(); ?> <div id=quot;contentquot; class=quot;narrowcolumnquot;> <?php if (have_posts()) : ?>

×