"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
0answers
35 views

Custom query for tag and custom tag from 2 post type

I have custom post type called items and added custom taxonomies type and sub-type. I like to query posts from both post and items post type that has art as either Tags or Sub type. Below is what ...
0
votes
0answers
61 views

Lazy loading Ajax offset not working

I am attempting to create a lazy loading ajax feature on my site. There is a 'click more' button which will then load 10 posts via ajax and append them to the HTML container. I want to display 10 ...
0
votes
0answers
18 views

query order by a function

I was wondering how to order posts by a function that returns a number. I've set up a query and i want to order my post by that number. Here is what I have: $foo = get_like_count(); and in the loop:...
0
votes
0answers
48 views

Convert $wpdb to WP_Query()

I have the code below which I would like to change into a WP_Query so that I can easily filter posts by taxonomies. I am having trouble understanding how I would add get_posts_by_author_sql( $...
0
votes
0answers
20 views

Search Post Types and the Meta Boxes

I have meta box called (orginalday), This i will save the post day when the user write post and save it in (pending), And i have form that have 2 input type to search post from day to day. So i need ...
0
votes
0answers
25 views

Query Search Not Working for Users

When I search for a User by their first name, all of their posts show up in the dashboard. When I search for that same User and add their last name, it does not show up at all. Not sure why this is ...
0
votes
0answers
29 views

Blog only showing one post even though more published

Why is my wordpress blog.php only showing one blog entry while I have two entrys in the blog at present and have checked both are published and they are and yes i do have my reading setup to my blog ...
0
votes
0answers
22 views

WPML: Custom query looping through languages & putting out one post each round

For a current project I use WPML to distinguish between languages and to manage authors/editors and what they are allowed to write and translate. While there are different language versions of the ...
0
votes
0answers
40 views

Keeping checkboxes checked WP_query

I have wp_query that allows the end user to filter the query using checkboxes. This works fine until pagination, all the user checked checkboxes get cleared on page 2 how do I get checkboxes to carry ...
0
votes
0answers
42 views

Filter by custom field - dropdown POST not working

I have a custom field "carbz" which has a number value. I am trying to give users a dropdown to select a number and then filter my posts based on the user's input. The current result is returning all ...
0
votes
0answers
37 views

Include in post navigation if field is checked

I need to display certain posts in the previous and next buttons using the_post_navigation() function. I want to to exclude any post with a checkbox that is not ticked. Another twist is that the ...
0
votes
0answers
137 views

Help optimizing slow WP_Query with meta_query

I'm trying to create a custom WP_Query. Right now, I have two meta fields, roi_min and roi_max. The ideia is to get posts that has a roi_min greater than the selected value, and a roi_max lower than ...
0
votes
0answers
69 views

Custom Post Type - shows pagination (w/404) or posts_per_page query, not both

I have a custom post type of 'gallery', and I'm using a template for the archive of 'page-student-gallery.php'. My admin settings for posts shown is 5, I'd like it to show 9 on this page, of just ...
0
votes
0answers
118 views

Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working

I'm trying to test the term for a post within a wp-query and for-loop. Everything works great however testing the terms via get_the_terms($post->ID, 'category') returns an empty array. $terms = ...
0
votes
0answers
22 views

Query Database for URL

I have a multisite setup and was wondering how I can query a database to find and retrieve a URL if it exists, otherwise, don't output anything... For example, using the two following domains which ...
0
votes
0answers
37 views

Empty pagination pages

I have a category file called category-exhibitions.php where I loop the exhibition category. Now I need the pagination there also, I am trying this but it gives me blank pages when I navigate to page ...
0
votes
0answers
72 views

Change sort order when using 'orderby' => 'type'

When doing a wp_query with the following parameters: $arg = array( 'post_type' => array( 'activity', 'publication', 'project', 'course' ), 'order' => 'ASC', 'orderby' => 'type', )...
0
votes
0answers
39 views

Wordpress loop uses unmodified posts array, why?

I have this code in a Wordpress template: $prepost = $post; $normal_args = array( // here goes the args ); $normal_query = new WP_Query( $normal_args ); echo 'BEFORE: ' . count($...
0
votes
0answers
86 views

Search by attributes or taxonomy

I'm trying to filter products by taxonomy or attributes, but I think the function has something wrong: global $woocommerce, $woocommerce_loop; $attribute = 'color-de-piel'; $values = 'Blanca'; $...
0
votes
0answers
83 views

Imported Content Doesnt Show Up On Frontend

I found similar problems posted couple times, for different custom post types, but none of the solutions worked for me and these, other questions, didnt have much info provided, I'll try to give as ...
0
votes
0answers
43 views

wp query custom orderby not custom field

I am working on a products archive page where I show 20 products on each page with pagination. Each product's price is calculated by a formule which gets his parameters by data saved in the database. ...
0
votes
0answers
64 views

WP_Query: Meta_Query with serialized value (or a workaround)

I have a post type Issue, that has meta values in form of associative arrays (that are saved as serialized strings to database). They look somewhat similar to this: [article_reviews] => Array (...
0
votes
0answers
18 views

Displaying Taxonomy titles with their post

Suppose i have a taxonomy note_navigation like this Class 11 --Science --> THis is children of Class 11 ----Physics --> Children of Science and grandchildren of Class 11 ------ QUantum Physics ...
0
votes
0answers
23 views

Custom Post Type Column Filter Not Populating HTML Select After Filtering

I am trying to setup a custom post type column filter. When the custom post type management page displays the filter is populated with all of the course custom post types. I then select an option and ...
0
votes
0answers
25 views

Displaying no post message in rather complex query that shows only future events

I'm trying to do something rather simple, which is display a message if there are currently no posts available. However, the environment I want to do it in is rather complex, as I'm using the Types ...
0
votes
0answers
94 views

Loop carousel slider in wordpress

Hello i create a custom post type clients to add client image but i was not able to loop all here my code I want this code to loop <div class="item active"> <...
0
votes
0answers
42 views

WP_Query using meta_query with LIKE doesn't return what it should

I am using this code to get stuff based on my custom field and custom content type. $searchTerm = 'bestafricanvideos'; $args = array( 'post_type' => 'sitemaps', 'posts_per_page' => -1, ...
0
votes
0answers
33 views

Change menu order in Restaurateur theme

I have installed a theme called Restaurateur, which includes a "Restaurateur Menu Item CPT" plugin that displays a menu page with fast food categories and meals. When you load the site, all meals are ...
0
votes
0answers
34 views

Query and compare multiple meta values

The problem: I have a custom post type of 'events' which has two metaboxes: cf_eventdate and cf_eventend. The first contains the event date, in the format: 2015-11-05. The second contains the end ...
0
votes
0answers
34 views

WP_User_Query from meta_key and orderby secondary meta_key

I have this code, which works as intended, but now I want to order these by another meta_key. I've tried using meta_query to get another key into the mix, but am still unsuccessful. I want to get all ...
0
votes
0answers
75 views

Loop through posts by category in descending date order

I am using standard posts to display news. I have three categories to assign news posts to, and a post is only ever assigned to one of these. Let's say I have post data like this: 01-Jan-2015 - ...
0
votes
0answers
64 views

Infinite scroll only works on Default Permalink

I have a custom post type list that I display on a page template. There are a lot so I decided to put infinite loading. After changing different queries, I at last made it work but only if the ...
0
votes
0answers
49 views

Multiple tax_queries: display posts titles from several custom taxonomie

Im trying to get this work. They do individually. function render_main_menu (){ $cpt = 'mycpt'; $tax = 'section'; $term = 'main'; $tax2 = 'paragraph'; $term2 = 'sub'; $loop = ...
0
votes
0answers
72 views

Standard WP_Query Returns No Results

Edit: found the problem. The fields I'm trying to filter on are custom fields. They were created with the "Load value based on the post's terms and update the post's terms on save" setting UNchecked. ...
0
votes
0answers
75 views

Only display the subcategory posts in the category page

I have worked with WordPress for a few years and never encountered such case where I need to display posts published under the sub categories of the parent category without parent's post or grand ...
0
votes
0answers
21 views

Custom query . How to restore parent in custom template

I have a custom query which looks if a page has subpages and if any exists loops over childs the codes <?php // get sub pages $subPages = get_pages( array( 'child_of'...
0
votes
0answers
16 views

Making sure to always display posts from three different authors

Say I want to display nine posts on my homepage, and have 3 authors on the blog. Using WP_Query or a similar method, Is it possible to make sure that at least 1 or 2 posts from each author is ...
0
votes
0answers
16 views

List all 3rd level pages in wordpress

I have page structure like this: Magazine -2015 -Article1 -Article2 -Article3 -2014 -Article1 -Article2 -2013 -Article1 -Article2 ...
0
votes
0answers
14 views

Different number of posts on different browsers and different language

I have ordinary WP_Query with featured posts and plugin Polylang, the problem is that different number of posts that is defined is showed in different language and I've noticed in different browsers ...
0
votes
0answers
23 views

Show recent posts from excluded category

I want to exclude category posts from index & archive pages, so I wrote this script in functions.php: function exclude_category($query) { if ( $query->is_home() || $query->is_archive() )...
0
votes
0answers
144 views

Querying custom tables using WP_Query

I am looking to extend the WP database by adding a custom table. I know how to do it using the $wpdb object; however, I have seen on some sites that it is better to use the WP_Query class, but I can't ...
0
votes
0answers
20 views

Retrieve images separately from multiple galleries within same post?

I am running WordPress 4.3.1. As part of a new feature, I am able to "add media" and create two or more image galleries. How can I use WP_Query to retrieve the images attached to each gallery ...
0
votes
0answers
29 views

Query all posts sorting first by the ones that match criteria, then the rest

I have two custom post-types 'office' and 'work'. A work is made by one office (I store the office ID in a meta of the work, named OFFICE); Now, in single-office.php, I need to list all the works, ...
0
votes
0answers
30 views

Editing custom post type

I've to do some edits to wordPress theme home page . This is the scenario. There are 4 posts being showed in home page under news tab now when i check this is using front-page template and in front-...
0
votes
0answers
113 views

Querying posts based off a jquery datepicker

I have two jquery date pickers that i'm trying to filter post with. I store the jquery date picker values into a hidden input. Then i'm grabbing them with a php $_POST[]. I'm using meta_query to query ...
0
votes
0answers
50 views

Website goes slow down after importing long database

I am working on a site which have 2 lakhs post and 15 categories. I have home page with 3 post of each category on home page. And after that its goes down while run home page and shows page not found. ...
0
votes
0answers
58 views

Ordering Posts by parent category, name ascending

I am currently creating a theme, and I have 2 parent categories: Budget and Brand. On home.php, I want to order all the posts ascending by their sub category name without showing the category title. ...
0
votes
0answers
110 views

Masonry layout within the loop

I have tried to to make a custom query, to some extend. it is working fine. But where i cannot make it work, is it to break after every 3 posts and do same thing (print div.row) and run same loop, For ...
0
votes
0answers
49 views

How to only show sticky posts in archive.php using WP_Query()?

Is it possible to slightly change the default query instead of building it from scratch? I started with the code below and it works. But all taxonomy filters do not work any longer. http://localhost/...
0
votes
0answers
34 views

WP Query using Advanced Custom Fields data

I have a page 'Repertoire' that uses a specific page template. The page has an advanced custom fields repeater field for 'Title' (text), 'Artist' (text) and 'Genre' (select). On the front end, I need ...