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’ ), ),

pass query string on url to filter media

As per the given url http….url…/author/name?MediaTag=tag1, below code may helpful… if(isset($_GET[‘MediaTag’])) //It will check the value of MediaTag (from address bar after ?) { $tag1 = $_GET[‘MediaTag’]; //Assigning value of MediaTag to the variable if($tag1) //Checking if variable have some value or not { query_posts(‘cat=1&author=” . $post->post_author . “&order=DESC&tag=’ . $tag1 .’&posts_per_page=12′ . ‘&paged=’ . … Read more

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