"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

2
votes
0answers
25 views

Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy

I have registered a custom post type "Animals" and also two custom taxonomies ("Vertebrate" and "Type") assigned to it, which have their own specific terms, for "Vertebrate" it will be "Mammals" and ...
2
votes
0answers
46 views

How to show in search results posts with a particular tag in a particular category?

As the home page of my blog I've a static page. There I want to show the navigation of the site. Category1 Sub-Category1 tag1, tag2, tag3 Category1 Sub-Category2 tag1, tag2, tag3 ...
2
votes
0answers
176 views

Warnings in nav-menu when visiting query pages

Using query-wrangler, similar to drupal's views, I created some query pages. When I visit these pages, in the top-navigation-menu there is this warning: Warning: in_array() expects parameter 2 to be ...
2
votes
0answers
104 views

Is it possible to orderby multiple meta_keys when using meta_value_num?

Reading through the order & orderby documentation, it's not clear to me whether there is any support to order based on multiple meta_key values. Obviously, using meta_query I can return posts ...
1
vote
0answers
60 views

WP_Query orderby and tax_query

My goal is to have custom posts type's posts (CPT for simplicity) from a custom taxonomy (CT for simplicity) let say CT Hometown with slug Nebraska to be listed grouped by another CT, let say ...
1
vote
0answers
53 views

How to query custom post types with mixed AND & OR statements for custom fields

I have a custom post type "events" which includes the custom fields "is_premium" (which is a true/false) and "premium_expiry_date" which is a date picker. On my front end, I want to have "events" ...
1
vote
0answers
68 views

Custom post type archive pagination query issue

I'm using the following query to paginate a custom post type archive. The number of posts on the first page is 11 (due to the page layout) and 12 on the following pages. The problem is that while the ...
1
vote
0answers
52 views

Configuring a meta query with multiple post types that have the same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one ...
1
vote
0answers
222 views

Query by 2 values of a repeater ACF field

Let's say I have a custom post type called Film, with a repeater field called Showings, with fields start_datetime and discount. I need to make a query for those Films that have at least one showing ...
1
vote
0answers
25 views

2 weeks ago from meta query meta value

This is my meta query within my posts query. 'meta_query' => array( array( 'key' => 'rw_membership_ends', 'value' => ??????? ...
1
vote
0answers
217 views

How to get latest posts from each category in regular order

let's say I have a main query and it displays posts from Movies and Music categories. I want the query to show always 5 latest posts from Movies and 5 latest posts from Music category. When I create a ...
1
vote
0answers
138 views

WP_Query with meta_query dosen't return results

I am trying to get list of posts filtered by fields I added using the advance custom fields plugin. I have more fields that I want to use but it doesn't work as I want it to. Here is what the query ...
1
vote
0answers
251 views

Pagination with custom query, custom search form, single and pages, ajax and no plugins

I've read a lot of posts here about pagination with custom queries and tried the suggested answers (like this one). It seems however that my situation is a little more complex, and in the existing ...
1
vote
0answers
48 views

How to get the post terms from a child taxonomy

I have the following code that gets the slug of the taxonomy "author" from a custom post type "books" and gets the post from another custom post type "authors" that has the same slug. <?php ...
1
vote
0answers
55 views

Automatically Query Parent Taxonomy

I have a custom taxonomy on my site that I query from the sidebar of the currently displayed term. Say I am on the Term X archives, then my custom post type of Products with the term of Term X are ...
1
vote
0answers
376 views

Get Recent Posts by Date in Multisite

Everything in explanation is about CDTuts I've created a WordPress Network and I want is to get the recent posts from all of the selected subdomain blogs. I need to get the latest All organized by ...
1
vote
0answers
91 views

Possible to filter custom post type with multiple meta data?

I'm wondering if it's possible in one loop to accomplish what I need to do. What I would like is to sort all custom post types by the meta data of county and put them in order which it is doing here. ...
1
vote
0answers
66 views

Stale $GLOBALS['post'] after custom WP_Query empty result set bothers my template, whose fault is this?

Story below looks to me like it's about a commercial Event Management plugin whose authors to me just don't seem very good at WordPress. But bear with me and let's see if there's also an issue in WP. ...
1
vote
0answers
63 views

database query with more than a couple meta hangs and doesn't complete

I have a development website with about 70 checkboxes for custom fields. The idea is the user selects one or more checkboxes, it queries the database for all posts that have a meta_key for the ...
1
vote
0answers
534 views

Custom WP_Query for WordPress Search Results with meta_query

I am using a custom query to generate my search results. The code I am using works perfectly without the meta_query variables in my arguments array. I am trying to compare multiple custom fields with ...
1
vote
0answers
61 views

How to output topics and replies in bbpress as table?

I need to output the bbpress topic and reply loop in a table format. I'm having trouble finding how one might do this Are there any suggestions on how one might do this? Can this be done using ...
1
vote
0answers
84 views

Meta Query And/Or

My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with ...
1
vote
0answers
89 views

Query custom post types and a specific page?

I'm using this query WP_Query('post_type=product&posts_per_page=8') I need to include a specific page into the query but not sure how to add it since I'm only specifying the custom post type? Is ...
1
vote
0answers
124 views

Custom post query by taxonomy

I am using WordPress 3.5. My query is, $args = array( 'post_type' => array('product', 'comic', 'magazine'), 'taxonomy' => 'Genres', 'term' => 'hot', 'posts_per_page' => ...
1
vote
0answers
92 views

How to increase load time of an archive/search page (WP_Query)

I'm currently looking at why the archive and search pages take so long to use, and have found that the bulk of processing time is spent on the query_posts that is called before the template has even ...
1
vote
0answers
306 views

How to filter a query by multiple meta keys and order by other meta keys

I'm trying to query posts using WP_Query and meta_query parameters: $args = array( 'post_type' => 'produkty', 'meta_query' => array( 'relation' => 'AND', array( ...
1
vote
0answers
508 views

Display one post from each term in a custom taxonomy

I am trying to display a list which shows one post (and information about the person posting) from each custom taxonomy term. The code I am using is as follows, but it is instead printing out EVERY ...
1
vote
0answers
64 views

Display posts with comments closed, with pagination?

i'm using a custom query, which needs to display all posts with closed comments. I have this <?php $the_query = new WP_Query('showposts=-1'); ?> <?php while ($the_query -> have_posts()) ...
1
vote
0answers
74 views

can these 3 queries be re-written as 1 query?

I am creating a Dentist directory site, and I have a taxonomy archive page which requires particular grouping and sorting (see below). So far I have only been able to achieve this using 3 WP_Querys ...
1
vote
0answers
71 views

WP_Query Attachment adds additional attachment count and need to link attachment to post url

I just wonder why WP_Query adding one more additional attachment with the defined number or posts. Also need to link attachment (thumbnail) to the post url. Here is my code <?php $query = new ...
1
vote
0answers
306 views

Does the WP_Query 'private' argument for post status only apply to privately published content?

The only peice of code that I can find that applies to this is on line 2430 in query.php in WP 3.4.1 foreach ( get_post_stati() as $status ) { if ( in_array( $status, $q_status ) ) { if ( ...
1
vote
0answers
174 views

Query most popular terms by taxonomy over 2 week period

I have written SQL for a query that pulls the most used taxonomy terms for selected taxonomies that are published, do not have a parent post are not in a comma separated list over the past two weeks ...
1
vote
0answers
76 views

Get page content by category or tag

I'm trying to sort of emulate the Views behaviour in Drupal with Wordpress, but doing it in theme templates. Now, I have pages that are assembled by using wp_query in the template to get posts ...
1
vote
0answers
437 views

How to use Meta Value Compare in WP_Query For Max and Min numbers

I am using WP_Query for visitor to filter the posts. The posts is about products. So in the filter, it has a field where user can select Maximum price and Minimum price. (Just like most of the ...
1
vote
0answers
85 views

Posts published last 10 minutes

i have a "featured" section on home page. i want to hide this section after 10 minutes of post publish time. here is the code, i am using. problem is that it hide the "featured" section after 12 ...
1
vote
0answers
218 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
1
vote
0answers
1k views

Filter wordpress post categories with jquery/ajax and pagination?

Currently I have a website working with Wordpress and Jquery Quicksand (http://razorjack.net/quicksand/). However I don't want to show all posts at the same time. I wish to show e.g. 6 posts and then ...
1
vote
0answers
383 views

How to order posts by meta_value and title

How do you order products in WooCommerce so that products are random, but at the same time featured products show first? Here is my code: $args = array( 'post_type' => 'product', ...
0
votes
0answers
21 views

How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?

Here is a simplified version of the code I'm using on a static homepage template made for a child theme of TwentyTwelve. I simplified some of the divs used for styling and just focused on the problem ...
0
votes
0answers
11 views

Returning error with WP Insert without getting an error in error log

I'm checking if a key exists in my database using $wp_db->insert() and am executing code based on the result. I know that if a row already exists it will return false and I want to use that to execute ...
0
votes
0answers
29 views

How to show subcategories using loop?

i am using wp_list_categories('child_of=54&title_li=') method to display all the subcategories, but it is showing only one, how can i use it with loop to show all the subcategories properly.
0
votes
0answers
15 views

How to sort post by custom table value

How can I sort my post by the maximum vote in custom table I have table like this:( user_votes) here post id 315 have votted two times so I just want to sort my posts by maximum vote. I am only ...
0
votes
0answers
23 views

Sub-menu on child pages as well as parent page

So here's what I'm trying to do: I'm trying to develop a theme that shows any sub-pages on the parent page. I've gotten this running successfully with a WP_query and a simple loop: <!--show sub ...
0
votes
0answers
12 views

WP_Query Meta_key is text value and need to sort as numeric not working

I have the following code below in my ~WP_Query`. $args[ 'meta_key'] = 'price'; $args['orderby'] = 'meta_value meta_value_num'; $args['order'] = 'ASC'; The custom field in question has historic ...
0
votes
0answers
13 views

Sort CPT by first letter of a meta field in a specific range

'I'm working on a way to display member profiles (Custom post type) sorted by the first letter of their last name in a given range. For example all members with a last name starting with 'A' up to ...
0
votes
0answers
40 views

Advanced wp_query - custom date and postname

I'm trying to write a query and sort by: custom date postname (in reverse order) because my postnames have a version string at the end and the latest entry should stay on the top of each other. ...
0
votes
0answers
49 views

70.000 custom posts on my site

My site have more than 70.000 custom posts. Admin panel not show all posts. how to fix it ? Month filter: more than 4.000 posts. it's normal.
0
votes
0answers
14 views

404 page is not querying my custom post

I have a 404 template page which is, obviously, designed for Not Found Pages. Within the code, I have the get_header(); where I place the global code for the site. There is a div that contains a style ...
0
votes
0answers
13 views

get_terms vs wp_query for pages - results inconsistent

I have a situation where a custom post type, with a related custom taxonomy. There are somewhere in the realm of 100 of these posts. The taxonomy associated to it has about 20 terms associated with ...
0
votes
0answers
22 views

Filter WP_Query output before it is accessed (pre_get_posts)?

I have read Using pre_get_posts with WP_Query and I'm not sure where to go with it. I have a recent posts plugin which adds variables to WP_Query - one of which can be 'offset' posts. The problem is ...