There seem to be three main ways to output content from Wordpress using its built-in functions, with
being the recommended one:
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/WP_Query" rel="noreferrer">WP_Query</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/query_posts" rel="noreferrer">query_posts</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/get_posts" rel="noreferrer">get_posts</a></li>
</ul>
What are the differences between them? (I understand that
is the class, and the other two are methods).
What is the cleanest way to have multiple loops on the same page, without any of them interfering with each other?
I'm looking for examples of how you program your WP loops;
e.g. output 2 separate post lists by category, with attachments, meta data etc.
This is the best reference I found so far:
<ul>
<li><a href="http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/" rel="noreferrer">Define Your Own WordPress Loop Using WP_Query</a></li>
</ul>
Code:
WP_Query
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/WP_Query" rel="noreferrer">WP_Query</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/query_posts" rel="noreferrer">query_posts</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/get_posts" rel="noreferrer">get_posts</a></li>
</ul>
What are the differences between them? (I understand that
Code:
WP_Query
What is the cleanest way to have multiple loops on the same page, without any of them interfering with each other?
I'm looking for examples of how you program your WP loops;
e.g. output 2 separate post lists by category, with attachments, meta data etc.
This is the best reference I found so far:
<ul>
<li><a href="http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/" rel="noreferrer">Define Your Own WordPress Loop Using WP_Query</a></li>
</ul>