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

How to have a category not show up in query post with page panigation?

When using cat in the query you need to specify the category id not name. Try this. <?php $gallery = get_cat_id(‘gallery’); $shirts = get_cat_id(‘shirts’); $hoodies = get_cat_id(‘hoodies’); $excluded_cats=”-“.$gallery.’,-‘.$shirts.’,-‘.$hoodies; $limit = 5; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts( ‘cat=”.$excluded_cats.”&showposts=” . $limit . “&paged=’ . $paged ); ?>

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;?>

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