Post count for category and tag

Don’t run a custom query to get the post count. This is already done by the main query. What you are doing is the same as eating the same piece of meat twice. 🙂 As said, the main query already return the amount of posts found via the $found_posts property. You can access and display … Read more

Multiple loops without repeating content

As explained in Codex post__not_in (array) – use post ids. Specify post NOT to retrieve. post__not_in argument have to be passed as array. Change your query to: $the_query = new WP_Query( array( ‘category__in’ => $project_category, ‘posts_per_page’ => -1, ‘post__not_in’ => array( $postid ), ) ); And it should work.

Archive for custom taxonomy lists all posts instead of current taxonomy

You have a syntax error in your query. According to the documentation for WP_Query, tax_query is an array of arrays of parameters, which is to say that it should probably look like this: ‘tax_query’ => array( array( ‘taxonomy’ => ‘semester’, ‘field’ => ‘slug’, ‘terms’ => $getterm, ‘include_children’ => true, ‘operator’ => ‘IN’ ), ),