"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
22 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
20 views

How to remove the most recent post from $the_query

Apologies for a very basic question: I've been searching for hours and can't find a solution. I have a Wordpress page that displays all posts of a particular custom type by using WP_Query to return ...
0
votes
0answers
17 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
20 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
21 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
32 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
22 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
30 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
23 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
26 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
40 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
49 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
40 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
44 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
31 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
18 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( ...
0
votes
0answers
14 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
14 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
20 views

How to : pagination in 3 different custom loops on the same page

I have this content in my index.php. 3 areas with 3 distinct custop wp_query loops to get different categories of articles in each one. I have set wordpress to show 12 articles by page, so it displays ...
0
votes
0answers
8 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
22 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
49 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
17 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
25 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 ...
0
votes
0answers
86 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
30 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
29 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
76 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
28 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. ...
0
votes
0answers
27 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 ...
0
votes
0answers
20 views

get_results no result back

I can't get a result back from this query...any suggestion? function per_match(){ global $wpdb; $myrows = $wpdb->get_results( "SELECT id FROM partite;"); foreach ($myrows as $myrow) { ...
0
votes
0answers
21 views

Query post & comments at the same time?

I have this query : $custom_query_args = array( 'post_type' => 'stream', 'post_status' => 'publish', 's' => $username, 'posts_per_page' => '10', 'paged' => $paged ); $loop = new ...
0
votes
0answers
47 views

Custom post type pagination page 2 404 error

Sorry to repost this but I haven't found a solution to my problem. I registered a custom post type instructor-emails and when I try to make the archive one post per page, the other pages return a 404 ...
0
votes
0answers
35 views

Trouble displaying custom fields within post type in WP_Query Loop?

I'm trying to write a query that displays a custom field within my custom post type 'Inventory'. The custom field name is category and the field type is taxonomy. The category is selected by a ...
0
votes
0answers
20 views

How to sort by meta value, then by other meta value

I've been tasked with creating a 'fully automated' agenda for my client. The goal here is to create an agenda for a conference. The idea is that one shortcode will automatically populate the entire ...
0
votes
0answers
33 views

wp_query with shortcode do_shortcode out of while

I have a theme that uses an accordion that needs nested short codes. I'm trying to get it to work in my wp_query. [av_toggle_container initial='0' mode='accordion' sort=''] [av_toggle title='Toggle ...
0
votes
0answers
77 views

WP_Query with multiple select fields

BACKSTORY: This is part of my WP_Query foreach loop, there are many fields that it takes into account (text, number & these are taxonomies). It works nicely like this. case ...
0
votes
0answers
85 views

Meta box field in wp_query

I am working with a recipe site. I need to filter some meta box field in my wp_query. But I can't. I have searched in google 2/3 hours. No solution. Here is my code: // Meta Box Field array( ...
0
votes
0answers
34 views

How to Create Random post once in a day

Hello Guys I am having issue with the code i found here I wanted to add specific custom post type to be randomized once in a day and i used the code i found here but that repeating the content on ...
0
votes
0answers
23 views

Query posts in current category but not attachment format

In my category.php i want to query posts in the current category but are not in post formats attachments. How do i achieve this? I currently have the below code that displays all the posts in the ...
0
votes
0answers
33 views

Custom WP_Query Not Displaying Anything

I am attempting to write a custom WP_Query to display posts by category, and I can not get these posts to display. I am using a child theme of Flat Bootstrap. Below is the code: <div id="primary" ...
0
votes
0answers
25 views

WP_Query for liked posts is showing all posts if none are liked

I'm using the plugin Favorites for WordPress to allow visitor's to like products presented with a Masonry grid on the site. On the site I have a page which lets the visitor see all his or hers liked ...
0
votes
0answers
28 views

Orderby Date and Category

Query and order by date, or query and order by category is no problem, but is there anyway to order by date and category? So if I query 30 Events (CPT), there might be 5 events per day so I want them ...
0
votes
0answers
73 views

How to get wp_redirect to work correctly

I have a new site that has had a permalink structure update. Old Structure: http://blog.mysite.com/%postname% New Structure: http://blog.mysite.com/%category%/%postname% My thought process was to ...
0
votes
0answers
155 views

Add relation OR to product attribute filtering

I have a WooCommerce shop, where products can be filtered by product attributes. On the frontpage a i have a filter, where i build url queries. So if i choose to filter by eg. "Artist name" and ...
0
votes
0answers
67 views

How do I get pagination working with custom wp queries?

I've created a custom query within a Page Template: $args = array( 'posts_per_page' => 9, 'paged' => $paged ) ; $my_query = new WP_Query($args) I would like the user to be able to ...
0
votes
0answers
52 views

Is there a good way to get all queried taxonomy terms?

For most cases, getting the queried taxonomy term is as simple as calling get_queried_object(), but I have noticed that if multiple taxonomy terms are queried, that function only returns one of them. ...
0
votes
0answers
63 views

WordPress - Meta query with JSON value?

Im using post meta to store some value. Im having the following in wp_postmeta table: meta_key mykey meta_value a:2:{i:0;s:1:"5";i:1;s:1:"2";} I need to return posts which have meta_value of 2. ...
0
votes
0answers
67 views

Multiple loops on search results page return empty on no results

I've got a search results page that has several loops on it. One loop returns our most popular posts, and the other returns the top 5 of another custom post type. We use these loops on the blog, on ...