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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)