Skip to main content

Unanswered Questions

1,216 questions with no answers
4 votes
0 answers
510 views

Should I hint table index for search query on wp_post

I'm currently inspecting a WordPress setup with multiple custom post types that should be included into search results. The database query for a search after the word Search looks like this: SELECT ...
3 votes
0 answers
2k views

Searchable meta value in user.php

I have created a new column in the user table list (admin page) and would like the column to be searchable in the search query, How do i add the meta to the search users query ? /** * Create user ...
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
139 views

Unable to create custom search results template page

I'm trying to create a search results page for our website and referring to the following documentation: https://codex.wordpress.org/Creating_a_Search_Page I created a new page template searchpage....
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
44 views

Custom Post Type not appearing in website search

I've built a custom theme from scratch for a client and have a few custom post types. For one in particular, FAQ, I wanted to hide it from showing individual posts (posts would only appear on its ...
2 votes
0 answers
242 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
627 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
358 views

How to search media library alt text and title fields

I need to be able to search in the WordPress media library alt text and title fields. I've previously used a plugin called Media search Enhanced by 1fixdotio (https://wordpress.org/plugins/media-...

15 30 50 per page
1
2 3 4 5
82