Skip to main content

Questions tagged [wp-query]

"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 global variable that holds the main query object prepared by WordPress based on a given request.

0 votes
1 answer
16 views

Adding a language rule and displaying posts with a custom taxonomy term on its archive page

The WordPress website I'm working on is available in two languages using Polylang, en-US and en-PH. I use CPT UI and have a custom taxonomy "subtopic" that is not multilingual. Under "...
Sum's user avatar
  • 11
0 votes
0 answers
18 views

meta_query post_date not returning results

I'm working on a query where I have a few conditions, one of them involving post_date. However, whenever I try to write my query, post_date doesn't return any matches. If I comment that part out, it ...
Nicole's user avatar
  • 1
0 votes
0 answers
11 views

Use custom url params with value from a custom field to return the post containing the field value

I got a list of links from an external api, that I want to associate with wordpress posts. The api links are distinguishable by an id. In each Wordpress post, there is a custom field where this id is ...
oivind's user avatar
  • 101
0 votes
0 answers
40 views

"Page not found" while on page 2 from pagination menu

all. I'm getting a "Page not found" message in my firefox tab when I click page 2 in my pagination menu. What's odd is, the content shows up just fine on all paginated pages. I've tried ...
harshclimate's user avatar
0 votes
1 answer
34 views

What is the easiest way to create a custom field archive?

So, here is the issue: I am using a plugin named User Submitted Posts, and it works great on its part. However, I still want to have that user content page the Twenty Twenty Four theme has by default, ...
Grond's user avatar
  • 1
0 votes
1 answer
21 views

WP Query: orderby with one meta key, but multiple values

I'm trying to order a wp_query using one custom field. It is a radio group with three values: G, S and B (These represent Gold, Silver and Basic). I've been following the documentation and have looked ...
Laurence O'Hare-Carroll's user avatar
0 votes
0 answers
19 views

Show post in elementor based on views and specific category with query id feature in elementor

I have two functions for query filter: function my_query_filter_most_views( $query ) { $query->set( 'orderby', 'meta_value_num' ); $query->set( 'meta_key', 'entry_views' ); $...
Danial Sohail's user avatar
0 votes
1 answer
21 views

Not displaying the wp_query object for the following code in the frontend

add_action('template_redirect', function () { global $wp_query; echo '<pre>'; print_r($wp_query); echo '</pre>'; die; });
Soumyadeep Chandra's user avatar
0 votes
0 answers
18 views

Filtering custom post type list in admin by custom meta key/value

I am trying to add an additional filter to be able to filter by a custom meta value but it is not returning any values when I would expect it to. Here is my code to add the filter dropdown (this seems ...
Tommizzy's user avatar
0 votes
0 answers
37 views

Why WP_Query with the same arguments retrieves different results?

wp_reset_query(); wp_reset_postdata(); $post = null; $course_args = array( 'post_status' => 'publish', 'post_type' => 'course', 'posts_per_page' => 5, 'order' => '...
0 votes
0 answers
15 views

WP_Query on custom taxonomy -> Location and Activity

A store location site displays stores based on region, town OR activity. I am using the WP Store Locator plugin and also using Divi Builder to create the pages. This is proving quite powerful and I ...
Adam Fletcher's user avatar
0 votes
1 answer
28 views

Orderby meta _value that is saved as an array

I want to order a WP_User_Query by a meta value. The meta key is a multi-select field, and the value is saved as an array. When I do a print_r of get_user_meta($user_id,'committee',true) this is what ...
LBF's user avatar
  • 529
0 votes
2 answers
49 views

How to use meta_query to retrieve posts from multiple custom post type

I am having two custom post type "meet_our_community" and "news" I have added a checkbox field named 'add_to_meet_our_community' from the acf to 'news' post type. Now I when tried ...
Amal's user avatar
  • 1
0 votes
1 answer
20 views

WP-Query and Searching Inside Arrays

I have a plugin that stories a grid of integers in meta fields like so: 'pricing_info' => array ( 0 => '1 | 1 | 1', 1 => '1.5 | 1.5 | 1.5', 2 => '22 | 22 | 22', ), So its ...
M. Jam's user avatar
  • 1
0 votes
1 answer
19 views

Modify WordPress Search

I'm facing a challenge with a WordPress project and I would appreciate the community's help in solving it. The issue lies with the search functionality. When customers type in a search term, such as &...
Roniery Rêgo's user avatar

15 30 50 per page
1
2 3 4 5
384