Getting Into The Loop
-
Upload
michael-yoshitaka-erlewine -
Category
Technology
-
view
45.176 -
download
0
Transcript of Getting Into The Loop
![Page 1: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/1.jpg)
Getting Into The Loopmitcho (Michael 芳貴 Erlewine)http://mitcho.com
January 23, 2010WordCamp Boston
![Page 2: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/2.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 3: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/3.jpg)
NOTE:• Will link to slides and code later
on http://mitcho.com/blog/• Please rate later on SpeakerRate
(find link on the blog)
Today
![Page 4: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/4.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 5: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/5.jpg)
Introduction
![Page 6: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/6.jpg)
Introduction• Hi, I’m mitcho.
![Page 7: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/7.jpg)
Introduction• Hi, I’m mitcho.
• Linguist, coder, teacher.
![Page 8: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/8.jpg)
Introduction• Hi, I’m mitcho.
• Linguist, coder, teacher.• At MIT. Previously at Mozilla. Now
working with Automattic.
![Page 9: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/9.jpg)
Introduction• Hi, I’m mitcho.
• Linguist, coder, teacher.• At MIT. Previously at Mozilla. Now
working with Automattic.• Programming PHP/MySQL since
2002?
![Page 10: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/10.jpg)
Introduction• Hi, I’m mitcho.
• Linguist, coder, teacher.• At MIT. Previously at Mozilla. Now
working with Automattic.• Programming PHP/MySQL since
2002?• Blogging (off and on) since 2007.
![Page 11: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/11.jpg)
Introduction• Hi, I’m mitcho.
• Linguist, coder, teacher.• At MIT. Previously at Mozilla. Now
working with Automattic.• Programming PHP/MySQL since
2002?• Blogging (off and on) since 2007.• http://mitcho.com;
@mitchoyoshitaka
![Page 12: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/12.jpg)
Introduction
![Page 13: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/13.jpg)
• Yet Another Related Posts Plugin
Introduction
![Page 14: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/14.jpg)
• Yet Another Related Posts Plugin• ...aka YARPP
Introduction
![Page 15: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/15.jpg)
• Yet Another Related Posts Plugin• ...aka YARPP• As seen on Laughing Squid, ma.tt...
Introduction
![Page 16: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/16.jpg)
• Yet Another Related Posts Plugin• ...aka YARPP• As seen on Laughing Squid, ma.tt...• Over 350k downloads
Introduction
![Page 17: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/17.jpg)
• Yet Another Related Posts Plugin• ...aka YARPP• As seen on Laughing Squid, ma.tt...• Over 350k downloads
• http://mitcho.com/code/yarpp or search for “YARPP”; @yarpp
Introduction
![Page 18: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/18.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 19: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/19.jpg)
The Loop
![Page 20: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/20.jpg)
The Loop
• “The Loop” is the mechanism by which posts are called from the database and then displayed.
![Page 21: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/21.jpg)
The Loop
• “The Loop” is the mechanism by which posts are called from the database and then displayed.
• On many pages—like the index or archives—it “loops” through each post.
![Page 22: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/22.jpg)
The simplest Loopget_header();if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile;endif;get_sidebar();get_footer();
![Page 23: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/23.jpg)
The simplest Loopget_header();if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile;endif;get_sidebar();get_footer();
{“The Loop”
![Page 24: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/24.jpg)
The simplest Loopget_header();if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile;endif;get_sidebar();get_footer();
{“The Loop” Sets up the post
![Page 25: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/25.jpg)
The simplest Loop
Every theme’s PHP files are built on this basic structure.
get_header();if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile;endif;get_sidebar();get_footer();
{“The Loop” Sets up the post
![Page 26: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/26.jpg)
The Loop
if there are posts while there are posts get the post do stuff with it end whileend if
![Page 27: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/27.jpg)
The Loop
if there are posts while there are posts get the post do stuff with it end whileend if
{“The Loop”
![Page 28: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/28.jpg)
The Loop
![Page 29: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/29.jpg)
The Loop
• The Loop is where you can use Template Tags.
![Page 30: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/30.jpg)
The Loop
• The Loop is where you can use Template Tags.• codex.wordpress.org/
Template_Tags
![Page 31: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/31.jpg)
The Loop
• The Loop is where you can use Template Tags.• codex.wordpress.org/
Template_Tags • It’s the the_post() call that makes that
possible.
![Page 32: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/32.jpg)
The Loop
if there are posts while there are posts get the post do stuff with it end whileend if
CC BY flickr.com/photos/myklroventine/1430113497/
![Page 33: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/33.jpg)
The Loop
if there are posts while there are posts get the post do stuff with it end whileend if
But mommy, where doposts come from?
CC BY flickr.com/photos/myklroventine/1430113497/
![Page 34: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/34.jpg)
The Loop
if there are posts while there are posts get the post do stuff with it end whileend if
But mommy, where doposts come from?
CC BY flickr.com/photos/myklroventine/1430113497/
![Page 35: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/35.jpg)
Every Loop has a query
![Page 36: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/36.jpg)
Every Loop has a query
• Regularly, WordPress chooses the right template file and query based on your URL.
![Page 37: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/37.jpg)
Every Loop has a query
• Regularly, WordPress chooses the right template file and query based on your URL.• codex.wordpress.org/
Template_Hierarchy
![Page 38: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/38.jpg)
Every Loop has a query
• Regularly, WordPress chooses the right template file and query based on your URL.• codex.wordpress.org/
Template_Hierarchy• /archives/123 → single post
![Page 39: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/39.jpg)
Every Loop has a query
• Regularly, WordPress chooses the right template file and query based on your URL.• codex.wordpress.org/
Template_Hierarchy• /archives/123 → single post• /archives→ archives
![Page 40: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/40.jpg)
Every Loop has a query
• Regularly, WordPress chooses the right template file and query based on your URL.• codex.wordpress.org/
Template_Hierarchy• /archives/123 → single post• /archives→ archives• /tags/chicken→ all chicken articles
![Page 41: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/41.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 42: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/42.jpg)
Customizing The Loop
![Page 43: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/43.jpg)
Customizing The Loop
• Themes control how information is presented...
![Page 44: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/44.jpg)
Customizing The Loop
• Themes control how information is presented...
• The query controls what information is presented.
![Page 45: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/45.jpg)
Custom queries
![Page 46: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/46.jpg)
Custom queries
Possible applications:
![Page 47: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/47.jpg)
Custom queries
Possible applications:• Create custom feeds/displays
![Page 48: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/48.jpg)
Custom queries
Possible applications:• Create custom feeds/displays
• ephramzerb.com/projects/feed-wrangler/
![Page 49: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/49.jpg)
Custom queries
Possible applications:• Create custom feeds/displays
• ephramzerb.com/projects/feed-wrangler/
• Pull information on other posts from within the theme’s Loop
![Page 50: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/50.jpg)
Custom queries
Possible applications:• Create custom feeds/displays
• ephramzerb.com/projects/feed-wrangler/
• Pull information on other posts from within the theme’s Loop
• Customize what information is displayed globally
![Page 51: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/51.jpg)
Custom queries
Possible applications:• Create custom feeds/displays
• ephramzerb.com/projects/feed-wrangler/
• Pull information on other posts from within the theme’s Loop
• Customize what information is displayed globally
Today’sexamples
![Page 52: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/52.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 53: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/53.jpg)
Roll your own query
![Page 54: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/54.jpg)
Roll your own query
EX:
![Page 55: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/55.jpg)
Roll your own query
EX:• Pull information on other posts
from within the theme’s Loop
![Page 56: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/56.jpg)
Roll your own query
EX:• Pull information on other posts
from within the theme’s Loop• Display other posts with a specific
criteria, like a tag.
![Page 57: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/57.jpg)
Roll your own query
EX:• Pull information on other posts
from within the theme’s Loop• Display other posts with a specific
criteria, like a tag.• Wrap it up in a shortcode [others]
![Page 58: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/58.jpg)
Roll your own query
![Page 59: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/59.jpg)
Roll your own query
The idea:
![Page 60: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/60.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
![Page 61: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/61.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
• Given a $tag...
![Page 62: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/62.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
• Given a $tag...• new WP_Query(array('tag'=>
$tag))
![Page 63: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/63.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
• Given a $tag...• new WP_Query(array('tag'=>
$tag))• Call it $my_query
![Page 64: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/64.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
• Given a $tag...• new WP_Query(array('tag'=>
$tag))• Call it $my_query
• Create a Loop for $my_query
![Page 65: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/65.jpg)
Roll your own query
The idea:• Create a new WP_Query object.
• Given a $tag...• new WP_Query(array('tag'=>
$tag))• Call it $my_query
• Create a Loop for $my_query• Do stuff in it
![Page 66: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/66.jpg)
Make your own Loop
Make sure the Loop controllers are using $my_query, not the default ($wp_query)
if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); the_content(); endwhile;endif;
![Page 67: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/67.jpg)
The result:
![Page 68: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/68.jpg)
DEMO:
![Page 69: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/69.jpg)
More about WP_Query
![Page 70: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/70.jpg)
More about WP_Query
Learn more from the Codex:
![Page 71: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/71.jpg)
More about WP_Query
Learn more from the Codex:• More information on the
parameters:
![Page 72: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/72.jpg)
More about WP_Query
Learn more from the Codex:• More information on the
parameters:• codex.wordpress.org/
Template_Tags/query_posts
![Page 73: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/73.jpg)
More about WP_Query
Learn more from the Codex:• More information on the
parameters:• codex.wordpress.org/
Template_Tags/query_posts• Tips and examples:
![Page 74: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/74.jpg)
More about WP_Query
Learn more from the Codex:• More information on the
parameters:• codex.wordpress.org/
Template_Tags/query_posts• Tips and examples:
• codex.wordpress.org/The_Loop
![Page 75: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/75.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 76: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/76.jpg)
Filter every query
![Page 77: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/77.jpg)
Filter every query
EX:
![Page 78: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/78.jpg)
Filter every query
EX:• Customize what information
is displayed globally.
![Page 79: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/79.jpg)
Filter every query
EX:• Customize what information
is displayed globally.• Hide all my tweets.
![Page 80: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/80.jpg)
Filter every query
![Page 81: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/81.jpg)
The idea:
Filter every query
![Page 82: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/82.jpg)
The idea:• Use the request filter to specify
that we don’t want results from the “tweet” category (#10)
Filter every query
![Page 83: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/83.jpg)
The result:
![Page 84: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/84.jpg)
DEMO
![Page 85: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/85.jpg)
Aside: the tools
Turn up the fire!
• Firefox getfirefox.com
• Firebug getfirebug.com
• FirePHP firephp.org
![Page 86: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/86.jpg)
Aside: the tools
Turn up the fire!
• Firefox getfirefox.com
• Firebug getfirebug.com
• FirePHP firephp.org
The “Pyrotrinity”
![Page 87: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/87.jpg)
FirePHP
Takes a moment to set up:
![Page 88: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/88.jpg)
FirePHP
Takes a moment to set up:
Use it like this:
![Page 89: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/89.jpg)
• Introduction• Loop basics• Custom queries
• Method 1: Roll your own query• Method 2: Filter every query
• Next steps
Today
![Page 90: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/90.jpg)
Next steps
![Page 91: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/91.jpg)
Hit the docs:
Next steps
![Page 93: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/93.jpg)
Hit the docs:• PHP manual: php.net• Codex: codex.wordpress.org
Next steps
![Page 94: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/94.jpg)
Hit the docs:• PHP manual: php.net• Codex: codex.wordpress.org• The source:
core.trac.wordpress.org
Next steps
![Page 95: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/95.jpg)
Hit the docs:• PHP manual: php.net• Codex: codex.wordpress.org• The source:
core.trac.wordpress.org• grep it!
Next steps
![Page 96: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/96.jpg)
Next steps
![Page 97: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/97.jpg)
Learn SQL
Next steps
![Page 98: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/98.jpg)
Learn SQL• The language that WordPress’s raw
database calls are in.
Next steps
![Page 99: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/99.jpg)
Learn SQL• The language that WordPress’s raw
database calls are in.• It’s really not that scary.
Next steps
![Page 100: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/100.jpg)
Learn SQL• The language that WordPress’s raw
database calls are in.• It’s really not that scary.• Lets you write filters directly on
different parts of the query.
Next steps
![Page 101: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/101.jpg)
Learn SQL• The language that WordPress’s raw
database calls are in.• It’s really not that scary.• Lets you write filters directly on
different parts of the query.• EX: mitcho.com/blog/how-to/external-
orders-in-wordpress-queries/
Next steps
![Page 102: Getting Into The Loop](https://reader034.fdocuments.in/reader034/viewer/2022050613/55548f7eb4c905186d8b46c5/html5/thumbnails/102.jpg)
Thank you!Questions?
Slides will be up on mitcho.com/blog/.See you at the Genius Bar!
mitcho (Michael 芳貴 Erlewine)mitcho.com; @mitchoyoshitaka