WordPress Theme – The Loop explained

I’ve been wanting to learn WordPress theme design for a long time now,
but every time I started reading about it I heard the words “The Loop”,
and never understood what are they talking about.

Well finaly I joust found this great intro to wordpress theme writing,
it’s simple, written for beginners, and explains the basics of what blog template writing is all about.

Matt’s post explains what the loop is – which from what i gather – a simple query that collects all the relevant posts to show,after first calling it with the first line:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

now you start dropping the other wp blocks into place just like lego:

the title,
the date,
the content

and thats it – now the loop will just drop these 3 again for the next post, until it runs out of posts.

From matt’s post:

There have many concerns and question about the template system used in WordPress. Mostly the concerns are with n00bs and the complications of PHP. “I want to change this and that, but don’t know PHP”. I hear this a lot. But the thing is, you don’t need to know PHP to change the Templates in WordPress.

so thanks Matt for helping me to finally understand what its all about :)

3 thoughts on “WordPress Theme – The Loop explained”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>