custom-wordpress-loop

Even better Custom WordPress Loop

It's a new year, time for a new improved custom WordPress loop! Here's a little code snippet that you can use to place a loop almost anywhere inside a theme, plugin or a framework like Thesis. First function does the hard work and return an two dimensional array with each post, custom post etc.. easily accessible. And designers will like this, the code is separate ... [Continue Reading]

How to change the order of posts in the WordPress loop

This is not rocket science but it took me a while to find the answer, so here it is. Situation: On some WordPress archive pages you'd like to order the posts by title rather than the default date order. The following function will do just that, it will merge the WordPress loop query with two new parameters 'orderby' and 'order' - leaving the rest of the query as ... [Continue Reading]

WordPress loop that searches custom fields

From time to time it's required to create a loop that will respond with posts, pages or custom posts that have a certain custom field. This code is a quick example. It's looking for post types that are 'pages' and a custom field that is 'scroller' with a value being 'true'. For all the parameter you can use including other operators like 'like' etc.. see this page on ... [Continue Reading]