38 Responses

  1. Agus MU
    Agus MU January 23, 2009 at 8:59 pm | | Reply

    It’s very complete! You always write a complete tutorials. I like it. Thanks Justin…

  2. Elliot
    Elliot January 23, 2009 at 11:48 pm | | Reply

    Is there a reason behind using endwhile + endif? why not use braces?

  3. Billyboylindien
    Billyboylindien January 24, 2009 at 2:08 am | | Reply

    Verry simple and complete doc.
    Merci beaucoup

  4. Pierre K.
    Pierre K. January 24, 2009 at 2:21 am | | Reply

    Hello Justin
    I have in fact read many articles about the loop, but yours is a model of precision and clarity. And I didn’t even know about the_title_attribute()…
    “Bravo !” as we say in french.

  5. Hugo Baeta
    Hugo Baeta January 24, 2009 at 5:32 pm | | Reply

    Just wanted to commend you for writing such an amazing and precious article – oh, and written fantastically well!

    I’ve been playing with WordPress for a while (since 2.0), and I feel this article is perfect to rewind and review your coding – something worth doing!

    Thank you so much for this and for the great website.
    Cheers!

  6. AC
    AC January 25, 2009 at 3:33 am | | Reply

    Justin, thanks so much for the clarity of this document. I’ve only recently been trying out this powerful feature on my own, and I’ve put a little something together on my website in the Superior Software List page. I plan to do much more and this explanation will be my go to source for learning the details. Right now, I’ve just cut and pasted snips of code from your themes to put my page together and it’s working. But like i said, I’d like to do more.

    It’s so great how powerful wordpress is. Someone like me could not have put together a page as nice as I currently have 10 years ago without learning a lot of code and spending a lot of time on it. Thanks again.

  7. Stefano
    Stefano January 28, 2009 at 4:35 am | | Reply

    Hi Justin,
    great tutorial!
    It’s a “must read” for everyone that wants to write (and maybe distrubute) its own theme.

    Can I translate it to italian and post to my reader at WordPressMania.it obviously with linkback and so on… Still too many italians can’t read english…

    Stefano

  8. BloggerSavvy
    BloggerSavvy January 28, 2009 at 10:12 am | | Reply

    I like that you break this down, statement by statement. In particular, paying attention to detail is what makes this post more valuable. I’ve been able to use it to do a bit of tweaking. I’m not a programmer, but I can edit or change existing code, so this is a great “lesson”. This post is definitely “in the loop” :) Bookmarked!
    Thanks!

  9. Tommy Day
    Tommy Day January 28, 2009 at 10:59 am | | Reply

    Justin,

    Great article, I feel like I finally understand the loop now, when before I just felt that I was copying and pasting it every time.

    Thanks!

  10. Richard
    Richard January 28, 2009 at 12:43 pm | | Reply

    Just like to say thanks for writing such an in depth, concise and easy to understand tutorial.
    I’m currently developing my first complete wordpress theme and have searched high and low for a proper breakdown on the loop. This has been the best explanation to date, just popped you into my RSS reader for future tutorials.

    Thanks

  11. Andrew
    Andrew February 1, 2009 at 6:00 pm | | Reply

    I really do think that many of the theme designers out there need to go to ‘WP Theme Coding 101′ to learn the basics about coding WP Themes.

    When helping people troubleshoot problems with their themes, I’m often pulling apart poor code that makes finding what I want difficult.

    Anyways, very good post, and I have bookmarked it for the time that I need to create a theme using very good coding standards.

  12. juliet
    juliet February 17, 2009 at 2:41 am | | Reply

    can you show me a code that the output is the multiplication table..?
    from 1-12…
    hope you will grant my wish..tanx..!!!

  13. Vitty Library
    Vitty Library March 4, 2009 at 4:46 pm | | Reply

    Thanks for the guide i had developed my first theme thanks a lot

  14. WordPress Loop | Theme Heven April 23, 2009 at 10:27 pm |
  15. Marlice
    Marlice May 25, 2009 at 4:14 am | | Reply

    Hello Justin,

    just read a tutorial in the mag “Web designer” (http://www.webdesignermag.co.uk) on how to create a wordpress theme by Dan Philibin and Michael Castilla. They reference to your great article. Thank you very much for your great work and greetings from Germany :-)
    Marlice

  16. Adi
    Adi June 1, 2009 at 2:41 am | | Reply

    Is this about setting the single post template..

  17. Kevin Lucius
    Kevin Lucius July 22, 2009 at 4:14 pm | | Reply

    Thanks a lot! I am just learning wordpress and php and this was very easy to follow and helped a lot. You really took time to explain every little bit. Thanks again

  18. Alex
    Alex August 7, 2009 at 8:28 pm | | Reply

    Thanks for this tutorial. It’s well written and I appreciated that you offered an example to look at before diving in. Great job! This was really helpful.

  19. kronos
    kronos August 28, 2009 at 12:56 pm | | Reply

    Yea, this is a real nice blog. Thanks you

  20. Никита
    Никита February 2, 2010 at 12:09 pm | | Reply

    I feel like I finally understand the loop now !!
    $)

  21. WP: Loop de Loop « Pubmedia Commons March 19, 2010 at 7:03 am |
  22. Suzanne
    Suzanne May 21, 2010 at 9:47 pm | | Reply

    Justin I’m experimenting with a custom content type that would be similar to a Facebook status update or tweet – short blurbs I don’t want in my blog entry stream. I display these blurbs on their own index page using a standard loop, but unlike a normal index loop, I want comments to show under each entry so it looks similar to the Facebook wall. The comment form does NOT need to be there but I’d like the comments to show. Is this even possible within the loop?

  23. stephen
    stephen October 20, 2010 at 9:27 am | | Reply

    This article helped me understand how to use the loop in a nice, clean fashion. I hate sloppy code and trying to learn from themes wasn’t getting me anywhere. Thanks so much!

  24. Richard
    Richard October 23, 2010 at 11:06 am | | Reply

    Hi Justin
    Thanks for your good explanation of the basic WP loop.

    I am presently struggling trying to find how to add ‘Permalink’ link at the end of WP3 loop in my theme anIMass!
    It is somewhere in here! But what & where & I have spent a lot of today trying to get it working?!

    <?php edit_post_link( __( 'Edit', 'anIMass' ), '| ', '' ); ?>
        	|
    
            	<!-- .entry-utility -->
    	<!-- #post-## -->

    Oh the joy & pain of jolly old WordPress!

  25. Lu
    Lu November 11, 2010 at 7:22 am | | Reply

    Hi Justin. Thank you so much for this tutorial. I’ve hunted high and low for a simple tutorial that explains to me what The Loop is all about, what each bit is for, why it’s necessary and where it goes. You words are simple and concise. You can’t imagine how useful it has been! :)

  26. Manoj
    Manoj January 10, 2011 at 9:12 am | | Reply

    Thanks much Justin. On my main / home page, I have a pic and excerpt of the most recent post. I want to add a previous / next link and when user clicks just display the excerpt and picture of the previous / next post. Any tips on how to accomplish this. This is what I have in my loop currently:

    <a href="" rel="bookmark">
    	Category:  | Published by: |
    <a href="" rel="bookmark" title="Permanent Link to ">Read the full post »
  27. Designing a Wordpress Theme January 15, 2011 at 6:57 pm |
  28. FC Barcelona
    FC Barcelona September 5, 2011 at 1:28 am | | Reply

    Hi, its a good post, maybe you could also make a tutorial about using the loop twice on a page, what to avoid and the proper way of doing it?

    FC

  29. Liam
    Liam October 20, 2011 at 11:41 am | | Reply

    Hey, thanks for the tutorial, its done me wonders so far, I was wondering however if its possible to control an image within the entry content as well as the writing .. Im trying to position my post images to the left of the text, but for some reason I can’t seem to get it to work ? Any ideas anyone ?? Thanks very much !!

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.