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

Ultimate Wordpress Query Search Filter plugin Results page id?

So, I am a Wordpress Novice(not even a Beginner) and I just started using Wordpress around two days ago.It seems I am already stuck on a problem. I am using a plugin called Ultimate Wordpress Query ...
0
votes
1answer
21 views

get all remaining posts after a partcular post id

We all know and its easy to get posts using wp-query. We can filter, orderby etc. I am in a situation, i would like to get all remaining posts after a post id, say 100. So what i need is to get all ...
2
votes
1answer
25 views

How to order by post_status?

I'm using get_posts() like this: $posts = get_posts(array('orderby' => 'post_status')) which is not possible cause it's not in the allowed keys in the parse_orderby() method How to get around ...
0
votes
0answers
12 views

How to list posts of a given format

I want to create new urls in my wordpress that list posts of a given format and category. I thought the url structure would make sense to be like this: /[post-format]/[category], i.e.: ...
0
votes
1answer
41 views

Related posts with WP_Query

I'm stuck with the related posts querying. I need the related posts to be displayed with any depth from the main parent. I have the following structure categories on my website: - Category level 1 -- ...
0
votes
1answer
20 views

WP_Query with meta_value LIKE 'something%'

I have read several questions like this (for example, this), but no equal. I WP_Query need to perform a LIKE on a meta_value. My problem is that I want the like is as follows: meta_value LIKE ...
0
votes
1answer
16 views

Wordpress Prevent 404 on missing custom post

The thing I am trying to achieve is to get data from a third party data source and display each piece of information as if it was a "post" in a WP theme. Now, the WP theme intrinsically works with ...
1
vote
1answer
21 views

How to connect two custom post types with nested loops

I have 2 custom post types created: "classes" and "teachers". I have created using Advanced Custom Fields plugin a field for "classes" custom post type, a multiselect that helps me add certain ...
1
vote
1answer
15 views

Display custom tags on pages that have a specific page parent

I would like to use Using the WP_Query or Query_Posts method. I'm currently using the query_post method. $terms_array = array(); if ($strurl == "somesite.com"){ $resparent = "18219"; //Page ID ...
2
votes
1answer
48 views

Ignore/Skip default value on orderby menu_order?

Is there a way to query all pages and order them by menu_order but ignore those pages that the default value of 0? I was trying to do something like this: $the_query = array( ...
0
votes
1answer
25 views

Modifing archive query affects show post count function

I'm trying to modify the archive query of archive page with this function hooked to pre_get_posts action hook. // Load our function when hook is set add_action( 'pre_get_posts', ...
-1
votes
0answers
17 views

BSI Car Rental System not working with Theme

On this page: http://www.londonautomotive.net/vehicle-hire/ Getting the following error when trying to book a car hire: Warning: trim() expects parameter 1 to be string, array given in ...
0
votes
0answers
6 views

Query that shows posts where title first char match a specific letter with post per page

Hi I am very new to wordpress syntax an I have a problem that I don't understand very well. I found some explanations but I think they don't fit to do what I want. I want to show only the posts from ...
-1
votes
0answers
17 views

Pagination pot showing

I have the following code listed below, where I reset the post data after words, I have tried resting the query data and the pagination still doesn't show. I have even tried to set, in the Reading ...
0
votes
0answers
20 views

Pagination on page.php with wp_query and query_posts

I'm trying to get pagination to work on a custom page.php and this has been kicking my butt... here is my site Here is my code: <!-- Page Blog Body Start ...
0
votes
0answers
7 views

pagination not working on page template

I am having a custom page for displaying community posts, where i want to display the posts posted in last 30 days sorted in desc order by meta value of post views which has to be greater than ...
-1
votes
0answers
13 views

Anyone know how to create comparison table with filtering? [closed]

The thing that I want to do is something like this: Comparing product features The visitor want to compare two product at the one time: iPhone 4s Vs iPhone 5s --> will show up 2 table side by side ...
0
votes
1answer
28 views

WP_Query - Accessing MetaValue from Query Result

Have this code. In doing a var_dump the meta_value is being retrieved under public object meta_value. I'm trying to access this data in a "WordPress" away instead of a more traditional PHP way. What ...
0
votes
1answer
24 views

Adding a parameter to the default query

I'm using ACF to create a "Featured" post section of the index.php and I'm having trouble then excluding that post from the main query. <?php $tmp = $posts; $isPaged = ...
2
votes
1answer
42 views

Changing Posts Per Page and offset with pre_get_posts

I have a filter using pre_get_posts to change the number of posts per page from 4 on the news landing page to 8 on all other pages (page 2, 3, etc). However I don't seem to have got the offset ...
0
votes
0answers
24 views

How to query and group posts by category?

/* * Loop through Categories and Display Posts within */ $post_type = 'post'; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies( array( ...
0
votes
1answer
38 views

WP_Query based on URL parameters

I'm looking for some help in creating a query based on fields I made in Advanced Custom Fields. I'd like to create a query that would loop through a custom post type, using arguments such as: ...
0
votes
1answer
22 views

How to add multiple custom URL variables?

I am building a Wordpress plugin that looks for different custom variables in the URL. The way I am able to achieve that right now is with this code: function add_custom_query_var( $vars){ ...
0
votes
1answer
26 views

Using tax_query to get single post per category

I have a list of magazines I need to categorize and sort. I have created a custom post type and registered a custom taxonomy to organize them. Category Structure: Print Magazines (parent category) ...
0
votes
1answer
42 views

Get pagination working for custom loops within page templates

I've got a custom loop for which I'd like pagination. The codex and examples I've found online indicate that I should get pagination as long as I pass the 'paged' query variable into the loop as the ...
0
votes
1answer
45 views

Custom post type and custom taxonomies display

I have the following CPT and Taxonomy in my WP: CPT: magazine Hierarchical: true Has Archive: true Custom Taxonomy: authorname (Magazine Author. Not the same as WP Author) Attached to: CPT ...
0
votes
1answer
19 views

WP_Query for CPT with filter by another WP_Query

I'm working on a project have 2 CPTs: Projects Units Every Unit has a meta value containining the id of Project Every Project is assigned a custom taxonomy named Regions Now I need get all Units ...
0
votes
3answers
69 views

Order By Multiple Meta Fields

I have two custom fields: meta_key1 is boolean (0 or 1). meta_key2 is a date value - 20150623 for example. Not all meta_key2 fields have an explicit value. It looks like their being treated as an ...
0
votes
1answer
15 views

Sort / Filter Queries

I'm working on a website, that showcases products, and now I'm working on the query part. Basically I want to have one page, that displays a list of products as a normal query, and then on top of the ...
0
votes
0answers
24 views

WP_Query search by meta tags shows all results everytime

I'm using a search form with WP_Query to refine results of some custom post type. It's working well if I search by items but not with text input with . It shows all results: Code for the search ...
0
votes
0answers
10 views

Trending Tags based on post views

I'm looking to display a list of the most trending tags on my wordpress blog - based on views that the posts within these tags have had, with a max tag count of around 10. I've looked into the ...
-1
votes
0answers
38 views

Woocommerce custom taxonomy query pagination

I'm using this custom query on archive page for Woocoommerce taxonomy to list all products and it works: // Retrieving current page number $page = (get_query_var('paged')) ? ...
0
votes
0answers
20 views

Filtering loop by query string in select option (custom field)

I'm trying to filter out some posts on a page template by a custom field. I could be attempting to solve this problem the wrong way - but I think a query string would be best here. Please advice if ...
1
vote
1answer
42 views

All sticky posts are returned in custom query

I have the following code: $recommended_args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'post__in' => get_option('sticky_posts'), ...
0
votes
1answer
19 views

WP_Query with offset and 'orderby' => 'rand', offset not working

I have the following situation: on my index.php I am showing the most recent 20 posts using WP_Query(). On the same page in another section I would like to display 3 more random posts from the archive ...
0
votes
1answer
26 views

Creating a Tabbed Widget

I have setup my widget to retrieve data from custom post types. I am using WP Query to show the data, but it still not showing. I have also setup the file in a gist for easier lookup ...
0
votes
1answer
31 views

WP_Query with custom post type search showing all results every time

I'm working on building a search form for some custom post type. Problem is, the search yields the same results every time, which is all posts of that custom type. Please advice: Code: Search form: ...
1
vote
1answer
54 views

Duplicates with WP_Query loop

I'm showing on my front page only posts with featured image. My problem is that on every next page load I receive the same results aka getting duplicates. I'm using ordering by custom field. Any ...
1
vote
1answer
47 views

Display only posts with thumbnail using WP_Query

I'm having hard times with showing only posts which have featured images using the loop. My PHP level is basic and any help will be really useful. So basically this is my original code : if( ...
0
votes
0answers
16 views

Add search box in Bootstrap slider carousel

I'm using the Wordpress theme 'evolve' which uses a Bootstrap slider on the front page with a 'Learn More' button on it. How do I add a search box instead of the 'learn more' button which will ...
0
votes
1answer
19 views

Custom loop - Isolating post meta output depending on current query taxonomy terms

I have started constructing is a page to display a series of products based on certain criteria. Each product is part of two separate taxonomies, one for brand and one for product size (each product ...
0
votes
0answers
52 views

423 queries in 6.098 seconds

For a few months now, i'm facing a lot of difficulties with one of my websites being too slow and i'm guessing the reason behind this could be the number of queries. At the moment these are the ...
0
votes
3answers
60 views

Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts

UPDATE: The hook is working with "classic" Wordpress filter (like post__in), so it's probably a Posts2Posts issue. I'm still looking for suggestions if someone has any idea. ORIGINAL POST I'm ...
2
votes
2answers
46 views

Select random post every day

I am looking for a script to select 1 random post per day in Wordpress. I found the code below, but this keeps gathering a new post every time I refresh the page: <?php function ...
0
votes
1answer
21 views

Weird Behaviour: Not all Wordpress Posts appearing

My wordpress posts have vanished on my dashboard but remain in the database? Meaning I have many 404 errors. All (52) | Published (4) | Drafts (7) | Trash (2) TOTAL =11 items (Note how theres only ...
1
vote
1answer
26 views

Targeting specific pages in the loop

I am having a custom query that calls in pages in an array like so: <?php $args = array( 'post__in' => array( 2, 7, 9, 11, 13 , 15, 17 ), 'post_type' => 'page', 'orderby' => ...
2
votes
2answers
189 views

Conditional to modify query results

I'll admit, I'm not a PHP expert, nor am I familiar with all of the WordPress functions and hooks. I've been stuck on an issue, searching for help without much success, and I was hoping that someone ...
0
votes
0answers
13 views

/page/2/ not showing

I am having a weird issue where when clicking on the pagination links the page just refreshes. The links are pointing to the proper pages(/page/2/) but when clicked, they do not show in the url. This ...
0
votes
2answers
43 views

How do I check if there is a tag in the title

I have many post with multiple tags ex: AMOS LEE, FOO FIGHTERS,TAYLOR SWIFT Post only have one of the tags in the title ex: “The Man Who Wants You” – Amos Lee How would I scan the_title() and go ...
0
votes
1answer
29 views

Using get_term_by to get tag id

I want to get posts that do not have a certain tag. I am having trouble retrieving the tag-id. The term id comes up as 0. Here is my code: $tag_name = 'my-sticky'; $tag = get_term_by( 'name', ...