"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to Wordpress which allows users to query the posts database using a number of criteria. 2) $wp_query is the default object that holds the main query object on each WordPress page.

learn more… | top users | synonyms

0
votes
2answers
8k views

How to display posts month by month?

How could wp-query be used to show posts month by month, and have it only show the past year? Or is it possible some wp_archive hack could handle this?
0
votes
1answer
714 views

Hide posts from users with a specific role

Simply put, I need to hide all posts on the frontend if they are written by authors with a specific role. The role I have created is called 'Suspended'. I'm happy with putting a simple IF statement ...
0
votes
1answer
525 views

How to order posts by custom WP role?

I currently have the following custom wp_query which displays posts from 2 custom WP roles, "custom_role_one" and "custom_role_two". It displays the posts from my custom post type of "listing". It ...
0
votes
1answer
2k views

How to count post type that has a particular term?

What is the best method to count the number of posts in a post type that have a particular term? I don't believe get_posts accepts a term query and I have had no luck with new WP_Query, though I might ...
0
votes
2answers
263 views

Slow speed and high CPU usage for my code. How to improve it?

this is my code. It gets the variables from the url. It is very slow and sometimes don't even complete. How can I improve it? Note: Most of the times some of the variables will not have any value. I ...
0
votes
1answer
666 views

Display different number of posts from one category on the different pages

according with Pagination with custom loop. I use the custom loop for display flash game. For make a pagination on the page with posts from one category (mydomain/category/categoryName) I used: ...
-1
votes
1answer
51 views

Enter a variable in the 'category_name' parameter

Is it possible to use a variable for the 'category_name' parameter? I have three pages: red, yellow, and blue. I have multiple posts that are categorized in three categories: red, yellow, and blue. ...
-1
votes
1answer
38 views

query posts in wordpress

I want to filter my query results just before the_loop starts in word press. I only want the results having term_id or term_taxonomy_id equal to 1. ...
-1
votes
1answer
146 views

Query not returning CPT posts

Ouch, banging my head against a wall! I am trying to query my post type 'clips' in index.php but it's returning only posts from the default 'post'. I need some insight! What am I doing wrong? My ...