"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

3
votes
0answers
30 views

Wordpress retrieving meta data for all custom post types in list view

Im having an issue in WP where php is dying, ive increased memory but the process jumps to 100% cpu usage then dies and apache throws a 500 error. Ive tried to get apache to log something, or php / ...
2
votes
0answers
19 views

Generate a tabbed submenu — from taxonomy term or submenu item — with sample content

I'm looking to generate a tabbed submenu from taxonomy term or submenu item and include sample content (three items per term/submenuu item). The styling I can do, the problem is the html generation. ...
2
votes
0answers
113 views

Custom WP_Query order by post_meta and (author) user_meta

I am having an issue that i couldn't find on google and elsewhere. To put problem in the context. I am making a wordpress site where user can put their tutor listing for giving a tutorials, and i am ...
2
votes
0answers
249 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
733 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 ...
2
votes
0answers
91 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
14 views

Query with custom taxonomy not working

I have custom post type 'mix'. And custom taxonomy 'meal'. And categories in custom taxonomy (one of that is with slug: breakfast) I have problems with making query. My code is : $args ...
1
vote
0answers
18 views

Query with relation and one without relation using multiple taxonomies?

I'm trying to use one query for two queries, one with an and relation and one without without having to do multiple queries and loops, is this possible? <?php $args = array( 'post_type' ...
1
vote
0answers
35 views

Using Advanced Custom Field for file upload, how do I load the file url

I'm trying to make a link to the file I uploaded with ACF so that it goes right to the pdf viewer from the Read More link, but I am getting an error here is the code <div class="col-md-6"> ...
1
vote
0answers
21 views

Show all data in database table and make it into an interactive table

I have to make a table where my data from my database can be stored and rearranged with every row. The name of every row should be a link to the function mymanual_edit(). Look at the image for ...
1
vote
0answers
42 views

How to display an other custom post type in a different custom post type's archive?

Background: I need to display all posts of a custom post type called "recipes", that have a specific taxonomy "fish", right under the permalink "www.mysite.com/recipes/fish". What I have done: I ...
1
vote
0answers
66 views

wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query

I'm implementing a form for a frontend post with a shortcode. The form is processed in the same function, reloading the page: function adicionar_ninhada(){ $user_id = get_current_user_id(); if ...
1
vote
0answers
44 views

Random ajax load only works with posts_per_page set to -1

I created a post loader shortcode, that uses AJAX to load posts. Even though I can set the order and order_by query parameters, the order_by should be random. From what I've seen on the web, ajax load ...
1
vote
0answers
41 views

Array Chunks and Inserting Varying HTML in WP_Query

I am trying to output the latest 5 posts from my blog. I would like each post thumbnail to populate divs in the following format. <div class="row full"> <div class="large-6 medium-6 ...
1
vote
0answers
35 views

Exclude Category filter from Portfolio section

I am stuck with this since hours and found lots of forum entries about NOT IN, WP_Query, category__not_in portfolio, editing JS/ CSS in Theme options or having bits of code to add to portfolio.php, ...
1
vote
0answers
22 views

Custom Taxonomy and tax_query Issue?

I am working on Plugin development and my plugin name is plugindev.I have a custom post type called team.I have a custom taxonomy Team_Category which is being registered by this code ...
1
vote
0answers
27 views

Prioritize posts in query by meta keys?

I have a CPT called jobs. In my single jobs page I am counting page views with these functions: /********* Post Views counter ***********/ remove_action( 'wp_head', ...
1
vote
0answers
21 views

Lists Posts from CPT that match the Title of the Page

I am trying to get all the posts associated with the Title of a page. This is what I currently have: <?php $title_to_tag_posts_query = new WP_Query( array( 'tag' => ...
1
vote
0answers
10 views

auto-populating custom nav with all items from custom post type

I have written the following code to take all of the posts in my custom post type "products" (created with ACF) and inject them each as an <li> in a custom nav menu. Everything is working ...
1
vote
0answers
196 views

get product title ID and price and product picture woocommerce by cat-id query select mysql

i have query that return categories in woo-commerce like this: SELECT wp_terms.term_id AS id, name FROM wp_terms INNER JOIN wp_term_taxonomy ON wp_terms.term_id = wp_term_taxonomy.term_id WHERE ...
1
vote
0answers
30 views

Search form not working with custom query?

My search query doesn't seem to work, the query in my url is all correct but the content just refreshes without finding the posts with the search term.. I got a custom search query and a function to ...
1
vote
0answers
26 views

meta_query not working as expected

I have 3 posts that each have two meta values. The first meta value is one that they all share (ac_parent_event). The second is one that is unique to that post (ac_thischild_date). For this function, ...
1
vote
0answers
66 views

ajax category filter

I know this is a big ask for you guys, but i can't seem to figure this out. I found this page : http://www.bobz.co/ajax-filter-posts-tag/#comment-28112 it shows how to make a dynamic filter for post ...
1
vote
0answers
81 views

get posts by meta_key from inside key of post meta

How can i get posts sorted out by meta_key from inner key array of post meta values, for more details please look at my code: // Example output of each post_meta, key is views array( 'all' ...
1
vote
0answers
21 views

WP_Query's “request” SQL Query

Lets say that I want to use a MongoDB for searching. I saw that WP_Query has a property named request which it seems that holds the SQL Query which is executed on the SQL database. Now if I write a ...
1
vote
0answers
27 views

Pagination inside of a edit page

I looked all over for this and could not find the answer I have two custom post types one is named 'venues' and the other is 'events' every 'venue' has multiple 'events' relating to it. I have a ...
1
vote
0answers
48 views

Combine two queries into one to use in loop

I have two queries. Simplified versions are the following: // First query $args1 = array( 'post_type' => array('post'), 'cat' => '-48', ...
1
vote
0answers
34 views

How can I create a WP_Query that returns posts where one meta_value <= another meta_value

I have a working, pretty complex SQL query hand-written in a function. For the sake of leveraging WP_Query optimizations, and simplifying my code for maintainability, I'd like to convert it all to ...
1
vote
0answers
77 views

inserting a post from an extern php file but post content doesn't show on wp site

I'm doing a php file that insert post's on my wordpress site. I'm filling all the fields in wp_posts, but the content doesn't shows on my wordpress site. I wonder if it's because the categories are ...
1
vote
0answers
97 views

How to add custom query filters in WP_User_Query

I am creating a list of all users in wordpress. For that I am using WP_User_Query with meta_query so that I can show only filtered users. I am stuck where I want to add a custom query filters in ...
1
vote
0answers
21 views

WooCommerce - display category X first

I have 4 categories in my WooCommerce store: Cat1 Cat2 Cat3 Cat4 Is it possible to list them (in asc order) on the shop page as: Cat3 Cat1 Cat2 Cat4 ie, show Cat3 first, then the other ...
1
vote
0answers
229 views

Slow SQL_CALC_FOUND_ROWS Query

We are experiencing very slow performance with queries that use SQL_CALC_FOUND_ROWS within the admin section of WordPress. We currently have about 125,000 posts on our site and use Varnish to cache ...
1
vote
0answers
140 views

meta_value_num not ordering all items

I am using meta_value_num to output a list of items in order by a custom field. The custom field value that is being passed is 1, 2 ,3 or 4. The order works for the first 7 items but after that they ...
1
vote
0answers
218 views

WP Query to have sticky posts first, with pagination and having a joint 'posts per page' arg with main loop

I am building a Wordpress site and have come to a bit of a wall while using a WP_Query, it started out quite simple but then sticky posts got thrown into the mix and it's becoming a bit harder to ...
1
vote
0answers
225 views

Slow WP_Query with 'OR' on meta_query

Essentially, I'm trying to query using a filter for the args being fed into WP_Query() like so: public function filter_wp_query( $args, $template_slug ) { $args['post_type'] = ...
1
vote
0answers
34 views

Add Custom Post Type of specific Custom Taxonomy to regularly blog loop

I want to add a CPT to be shown in the blog. I figured out that I can use the filter hook pre_get_post to get the query object and I can modify it. However just adding another post type to the loop is ...
1
vote
0answers
137 views

Meta Queries - should nesting work after WP 4.1?

I have a rather huge meta_query here and it hangs at execution: browser just won't load the page, it goes on loading ... As far as I know this should work after WP 4.1 (I have it). Also tried ...
1
vote
0answers
322 views

Include data from custom table in WP_Query

I'm building an Estate Agent website. They have a system where they add their available properties and sends them all to the main property portals. As part of this, the system also sends all the ...
1
vote
0answers
144 views

How to make search for posts using get method?

So I am building a WordPress theme for myself to meet my needs, so what I am looking for now is make a search using a get method in PHP. If my URL is something like this : ...
1
vote
0answers
25 views

Query posts by last comments

How to query posts by lastest comment, like what happens here, if some one comment on a post from the dark ages it will popup to the top.
1
vote
0answers
295 views

tax_query OR with empty result returns all posts

I'm running a WP_Query with a tax_query with two tax_query statements with an OR relationship. $tax_query_terms = array( array('taxonomy' => 'post_tag', ...
1
vote
0answers
203 views

WordPress ignoring LIMIT / posts_per_page despite being in wp_query

Using WP query: $myquery = new WP_Query( array( 'posts_per_page' => $instance['count'], 'meta_key' => 'mywp_post_views_count', 'orderby' => 'meta_value_num', 'order' => ...
1
vote
0answers
161 views

Conflict with get_posts and the_content

I have this snippet in my header.php to display a slider: <?php $args = array( 'post_type' => 'post', 'posts_per_page' => 6, 'meta_query' ...
1
vote
0answers
337 views

WP_Query Order by Specific Post ID First

I'm creating a website where I have a need to show a set of posts from a custom loop but I need to display a specific post first. This post will be dynamically specified in the URI by a $_GET ...
1
vote
0answers
682 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
104 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
115 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
62 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
787 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
59 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' => ??????? ...