"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
1answer
386 views

Best practice for multiple queries on page

On my WordPress site I have three categories 'moviestar', 'interviews', and 'movies'. On a 'moviestar' category page that is entitled 'Angelina Jolie' (and with a custom variable starname='Angelina ...
0
votes
1answer
230 views

Help with hierarchical custom taxonomies and permalinks…almost there

I'm trying to get permalinks working with custom taxonomies and custom post types. Following the instructions here I was able to get it almost working, but one small glitch. The code to register ...
0
votes
1answer
272 views

Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

I have a custom-taxonomy for a custom-post-type just like categories. I've used the standard loop in my taxonomy-event_type.php template so far … if ( have_posts() ) : while ( have_posts() ) : ...
0
votes
2answers
2k views

WP_Query multiple use of relation and/or

I have 2 custom fields that I would like to do a meta query on for a custom post type: start_date status The outcome that I am looking for is (start_date >= 1332115200 AND status = 1) OR ...
0
votes
1answer
518 views

How to Check if a Child Category is Being Queried

I need to change the number of posts queried for specific categories 'Recipes' or 'Product Reviews'. The below code works great for this, I have it in functions.php: function ...
0
votes
1answer
344 views

Compare meta_query decimals not working right

I have a custom field named 'rating' that holds decimals from 1.0 to 10. I am trying use wp_query to get me all the posts with a rating of 8.0 to 10. What I have so far almost works perfectly but it ...
0
votes
1answer
720 views

Wordpress query by multiple Custom fields and order by date

So here is my query: $args = array( 'post_type' => 'Event', 'posts_per_page' => 1000, 'meta_key' => 'event_informations_show_on_the_homepage', 'meta_value' => 'Show on ...
0
votes
3answers
518 views

Using next/previous_posts_link with customised search

I have a few different searches on my website: "Species profiles" (custom post type search) "Glossary" (custom post type search) Generic, site-wide search Currently I'm using search.php; ...
0
votes
1answer
1k views

Use of caller_ get_ posts

For what purpose following parameter is used caller_get_posts
0
votes
1answer
369 views

Query WP Page for Buddypress Group Home

I've created a new home template for my buddypress groups called front.php. With the code below, I've attempted to display the content of a wp page whose name corresponds to the group name. The loop I ...
0
votes
3answers
3k views

How to make WP_Query 'post__in' accept an array?

I have a function that returns a comma separated list of post ids that a particular user can access. I want to use this list in a WP_Query loop. The custom function: $array = user_albums(); foreach( ...
0
votes
1answer
809 views

How to Get All Posts but the Private ones?

I am creating a frontend mosaic view where i need to show the most recent posts. So i need to show all published posts to every visitor, but keep the private ones for the logged in users. I know how ...
0
votes
1answer
293 views

Does using a custom query_var create a security hole?

Say I put the following code in functions.php function add_my_query_vars($qvars) { $qvars[] = "new_var"; return $qvars; } add_filter('query_vars', 'add_my_query_vars'); If somebody requests ...
0
votes
3answers
4k views

WP-PageNavi gives me a 404 when using WP Query

I see that there are a lot of similar questions here at WPSE, and I've tried many of the suggestions mentioned trying to solve my problem but with no success. I have a category called News. In this ...
0
votes
1answer
364 views

Wp-query causing problems with the_content();

I'm using some code provided in an answer on here to calculate "post X of Y" and display pagination icons on single.php. It works beautifully but it's causing problems displaying the_content(); On ...
0
votes
1answer
2k views

How to create a dynamic page based on form data with a plugin?

I have a form that users fill out. When they finish, they are redirected to a 3rd party site to set up payment options. After completing the payment process, they are sent back to my site with a ...
0
votes
2answers
383 views

Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?

I have an IF statement shown below that runs one of 2 custom queries, based on the url. The problem I'm facing is if the url contains pagination such as /page/2/, my query breaks because the url isn't ...
0
votes
2answers
1k views

How to change a custom query into a standard loop?

I'm trying to modify how results are displayed in a post list that's currently controlled by the code below. However, it's not built in the WP_Query while ( $the_query->have_posts() ) : ...
0
votes
1answer
658 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
500 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
2answers
262 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
663 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
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
143 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 ...