26 responses to “Coding the WordPress Loop”

  1. Agus MU

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

  2. Elliot

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

  3. Billyboylindien

    Verry simple and complete doc.
    Merci beaucoup

  4. Pierre K.

    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

    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

    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. Justin Tadlock on properly coding the WordPress Loop — WPCandy — WordPress Themes, Plugins, Tips, and Tricks

    [...] With the Loop being the most important part of any WordPress theme, you might want to learn one thing or two about it. [Link] [...]

  8. Stefano

    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

  9. BloggerSavvy

    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!

  10. Tommy Day

    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!

  11. Richard

    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

  12. Weekend Links - Jan 29, 2009 | OMNINOGGIN

    [...] Coding the WordPress Loop – Have you ever downloaded a WordPress theme with sloppy code? There’s probably a good chance you have. Either more than 90% of themes have sl… [...]

  13. Andrew

    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.

  14. WP Thoughts » Blog Archive » Coding the WordPress Loop - Part 1

    [...] This post is inspired by Justin Tadlock. Share and [...]

  15. juliet

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

  16. Vitty Library

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

  17. WordPress Loop | Theme Heven

    [...] Read More … [...]

  18. Marlice

    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

  19. Adi

    Is this about setting the single post template..

  20. Kevin Lucius

    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

  21. Alex

    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.

  22. kronos

    Yea, this is a real nice blog. Thanks you

  23. Codelobster vs YouCMSAndBlog WYSIWYG Vs Aptana IDE for PHP, CSS, HTML, CMS (WordPress, Joomla, etc) « Sadhas Blog

    [...] function name you add (it’s the way I write action and filter functions). I’ve included the WordPress loop by Justin Tadlock, explained in great detail on its website, as an example of a large code template, and you can [...]

  24. Никита

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

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 (e.g., 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.