query_posts and sub pages?

I’m pretty sure you can use get_pages (http://codex.wordpress.org/Function_Reference/get_pages) function to solve this. It has child_of parameter which does exactly what you wanted. The only problem is that it returns posts and not set $wp_query, so you can’t use it as loop, but you can always call setup_postdata and then use template tags as in normal … Read more

Collect posts from last 48 hours

Never tested this ,but i believe you need to add WHERE clause to your query with time difference like so : $timediff .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-2 days’)) . “‘”; you can find it also in the codex http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters If you do not want to use on query, but inside the … Read more

How to limit the number of posts on the home page?

here’s what I ended up doing: <?php query_posts(array( ‘category__not_in’ => array($headline), ‘post__not_in’ => $postnotin, ‘paged’ => $paged, ‘posts_per_page’ => 5 )); if ( have_posts() ): $postCount = 0; ?> <?php while ( have_posts() ) : the_post(); $postCount++; if ($postCount < 6) { ?> [all my code] <?php } #end if ?> <?php endwhile;?>

Query specific posts from parent by slug rather ID

there are two WordPress functions you could try: http://codex.wordpress.org/Function_Reference/get_page_by_title (as suggested by @t31os in the comments to your quoted link) http://codex.wordpress.org/Function_Reference/get_page_by_path if you have already tried them, please describe how these failed to do what you want.

orderby not working for query_posts using array of IDs

I think I got it. You’re querying for sticky posts. Attachments can’t be sticky at least by default. Hence, you’re see the normal loop order when sticky posts are involved. So if you add this to your second args array: ‘ignore_sticky_posts’ => true I think your problem should be resolved. Here’s the relevant codex section … Read more