Exclude categories from postquery

You have missed a & before showposts in the query. Also showposts is depracated. Try using posts_per_page instead. <?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 . “&posts_per_page=” . $limit . “&paged=’ . $paged ); $wp_query->is_category = true; … Read more

Custom Post Type Query W/Category Dropdown

You seem to be using 2 separate queries there, the first (query_posts) won’t do anything, and the second is the query that will be used. Have you tried: $args=array( ‘category__in’ => $cats, ‘post_type’ => ‘profiles’, ‘posts_per_page’ => 10, ‘order’=> ‘ASC’, ‘orderby’ => ‘title’ ); $loop= null; $loop = new WP_Query($args); Try that instead of: query_posts(array( … Read more

Magazine style frontpage with multiple categories/loops and no duplicate posts

I wrote a class specifically for passing data between widgets classes using static variables and it will work for your use case as well. Grab the class here. The way you would use this is as follows for each custom loop: $exclude_ids = IntermediaryData::get(); //Retrieve previous exclude IDs $args[‘post__not_in’] = $exclude_ids; //new WP_Query($args); Custom loop … Read more

Notting but the latest post content keeps on being loaded

OK, so you’re not using AJAX (you didn’t share any Javascript here, so I may be confused as to what I’m looking at) but this line: <?php $args = array(‘posts_per_page’ => 1); query_posts($args);?> indicates you are setting the number of posts to be displayed to just 1, hence the “posts_per_page” value being set to 1. … Read more

show all in query_posts on category.php?

You could add a url parameter for posts per page. Something like this: $pppage = ( get_query_var( ‘posts_per_page’ ) == ‘all’ ) ? -1 : 45; query_posts( array( ‘posts_per_page’ => $pppage ) ); then you can set your URL with the parameter posts_per_page=all if you want to show all the posts, if it doesn’t find … Read more

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