Unanswered Questions
968 questions with no answers
4
votes
0
answers
609
views
How to reload a select box of posts dynamically?
I'm using custom meta boxes for a project. I have created a custom taxonomy (select box) and I have another select box populated with Posts. I need to only load the posts based on the selection of the ...
3
votes
0
answers
467
views
WP_Query with tax_query, order by most 'matches'
TL;DR:
How can I sort a WP_Query based on how many 'matches' there are on the tax_query set. Furthermore, how can I then add more posts if the posts_per_page is not met due to the tax_query added?
...
3
votes
0
answers
1k
views
Show all parents and children in custom post type in right order
I would like to show all posts from a custom post type on one page with the ordering exactly like in the backend. I get the right ordering with wp_list_pages, but of course without the content.
...
3
votes
0
answers
76
views
Select menu should display categories and the item's depth
I have a select menu of a custom post type in the header.php:
<?php
$selectloop = new WP_Query( array( 'post_type' => 'products', 'posts_per_page' => -1 ) );
echo '<form>&...
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
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
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
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
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
274
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
0
answers
255
views
How To Remove/hide some specific categories from two different categories widget from sidebar
I have two categories sidebar widgets with different topics on my site. I want to hide some specific categories from each of the widgets. Is there any way to do so?
Suppose I have total Categories ...