So my understanding of the Loop is that it refers to while( have_posts() ) : the_post(); - i.e., the part of the code that loops through each post in turn - and therefore it's not accurate to call it an "if/else" loop. It's a "while" loop, which is only executed if there are posts to loop through. If you were doing something totally crazy with your templates, such that you could safely assume that have_posts() were true, you could still invoke the Loop. It would be bad programming practice and the possibility should not even be mentioned to beginners, but you could do it.
IF and THEN do not translate to IF and ELSE. Php "else" means "otherwise"; THEN is more accurately represented by a set of curly braces {} or a colon.
I like the conditional tag examples, but I don't think they should be the first thing presented to a reader just learning how to deal with template tags. You're just trying to get across that some template tags need to be placed inside the Loop to work properly, and how this should be done, right? Maybe discussing simple uses of the_excerpt() or the_meta(), and then progressing to the examples of conditionals and other things that can be added, would be better. Also, the examples need real code along with the pseudocode.
I can try to take a shot at this myself tonight, if the stars are smiling on me and I have time...
yami 19:39, 7 Apr 2005 (UTC)
When I use the code
<?php wp_list_cats('sort_column=name&sort_order=asc&optioncount=1&use_desc_for_title=0&child_of=3'); ?>
I'm only getting the children of category 3, not *all* of the top-level categories & *only* the children of Cat3. Am I missing something?
PaulFChapman 07:24, 13 Jan 2006 (GMT)