Unanswered Questions
2,272 questions with no upvoted or accepted answers
2
votes
0
answers
28
views
get_meta_sql hook is not firing
WP_Query uses WP_Meta_Query. I thought this calls the WP_Meta_Query::get_sql() to define the meta query SQL which is where the get_meta_sql filter is applied.
I can't get the get_meta_sql filter to ...
2
votes
1
answer
23
views
WP_query() Simulate Missing "NOT" relation to Reverse Results?
I have a working and complex "args" ("tax_query") array which returns results.
I now wish to get the missing results, this is a "boolean" NOT operation (which "...
2
votes
0
answers
448
views
How to efficiently find "duplicate" posts, where the titles are different, using metadata to match posts?
The website I'm working on collects information on film reels. A 'film' is a custom post type. Each 'film' is one post.
The user bulk uploads films from different sources. Because of this, some films ...
2
votes
0
answers
217
views
Query custom post type and group by taxonomy
I struggle a bit with my piece of code - it's main goal is to show list of custom post type (called "career") childs grouped by custom taxonomy.
How it should work?
A user see default list ...
2
votes
0
answers
1k
views
Print custom field in Query Loop block
I have added a custom field with the Advanced Custom Fields plugin. I can print the content of the field on the post itself using the acf shortcode ([acf field="date"]) without issues.
...
2
votes
0
answers
1k
views
is_user_logged_in not working from WP-API (wp-json)
I want to hide certain posts from visitors that are not logged in. The code below works perfectly when the visitor visit the page but not is I try to see all the pages from the API with wp-json/wp/v2/...
2
votes
0
answers
241
views
Hiding Draft Post In Admin
Does anyone know of a way to hide draft post so that when "All" post is selected, draft post is not included?
I tried adding this code to my functions.php file but it lead to an error, I'm ...
2
votes
1
answer
318
views
Meta query field order together with post_date order causes posts without the meta field to be unordered
I've managed to get wordpress to do a descending order on a meta_query field called start_date which is saved in Ymd format in the database by the ACF plugin.
However in my query the other post types ...
2
votes
0
answers
56
views
How to search by a post and a category name on wordpress at the same time?
I wanna change the default behavior of wordpress search engine. Basically, I want to choose between 2 paths when the user informs a term on the search input:
Find the posts or custom posts that have ...
2
votes
0
answers
577
views
REST API: upload media with advanced custom fields (ACF)
Aim
I am trying to upload media via the REST API. I have successfully got it working, except for with the ACF data.
Problem
The media uploads successfully, but the acf fields are blank.
Code
const ...
2
votes
0
answers
626
views
Show Post Count of a Category
I've been stuck on this for a little while now, and have tried multiple ways to achieve this with no luck. I've been looking for two ways to display the total posts found on a specific, and non-...
2
votes
0
answers
273
views
Iterating through $wpdb query without using get_results for large query results
Traditionally, whenever I've needed a real mysqli_fetch for things like importing thousands of rows of data, I've used my own database connection and framework. But I was thinking there must be a way ...
2
votes
0
answers
418
views
Front page with registered query params in URL shows blog archive instead of front page
WordPress version: 5.4.1
I've built a plugin that includes a shortcode. The shortcode shows a product listing and has a couple of filters. The filters trigger a page refresh through JS with query ...
2
votes
0
answers
141
views
What's the point of the query_vars filter?
WordPress doesn't seem to support named parameters in a query string (like ?foo=123&bar=456) unless you explicitly allow them by doing add_filter('query_vars'...). Why is this? What (presumably ...
2
votes
1
answer
360
views
Get image of latest post from taxonomies/categories
I have a custom post type "Artworks" with a custom taxonomy "Artists". I have a page where I list all the entries from the "Artists" taxonomy (Artist 1, Artist 2, Artist 3, etc.).
How can I get the ...