Questions tagged [search]
The method by which users find information on your WordPress site
1,799
questions
0
votes
1
answer
14
views
Display different sidebar based on search results from one category
I have a website with a plant index page. It has a custom sidebar using A-Z Listings and a search form that only returns results from the 'plantindex' category.
When using the sidebar search form, say ...
0
votes
2
answers
32
views
How to include custom fields in wordpress search
As you know WordPress search only look at the post titles and contents, but I want the search to include also a custom field. Let me explain more:
Consider a movie post with the title "Fast Five&...
1
vote
0
answers
53
views
Custom Taxonomy in custom REST API search
I am building my first theme where I use a custom search and I would like to include the ability to search by custom taxonomy.
Currently, the taxonomy term shows up in Postman but no posts with that ...
0
votes
0
answers
50
views
Extend search query to search meta keys values based on search string
I want to create an autocomplete AJAX search and I'm trying to have it where when the user starts typing, the list populates titles matching that search string.
My issue is in the WP_query, because I ...
0
votes
0
answers
33
views
AJAX multiple search boxes not merging with array merge
this is a very frustrating problem.
I have some search boxes for different feilds on my site. some are acf meta fields, another is for title, and another for a keyword taxonomy.
But on the front end, ...
0
votes
0
answers
26
views
Meta_query question
There is a problem with compiling a request to display posts by meta_query.
Need to output posts whose title contains a substring.
Can't figure out where I'm wrong. Can someone help?
$inputValue = '...
0
votes
0
answers
21
views
Product Search in search.php
i make a custom product search in woocomerce search.php.
but I am not getting correct product name,image, link. Although it worked fine with posts. Tell me what I need to change in my code so that I ...
0
votes
0
answers
19
views
Display taxonomy terms when adding a link in the admin
When you add a link in the admin and make a research, all post types are displayed, but I wondered if there is an easy way to display also taxonomy terms. It would be very useful.
Thanks!
0
votes
0
answers
11
views
Need help to be able to searching by tag and title
Hello I am trying to get my search bar to search by titles and tags. I have a function working to search by titles but I cant seem to figure out how to search by tags. I have added the code below to ...
0
votes
0
answers
18
views
Searching for a custom meta from user.php in the admin
I am trying to extend the standard user search to 1 specific custom usermeta.
I am following the great answer provided in this question.
I am still not able to get any result when I search for this ...
0
votes
1
answer
24
views
Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?
I've got a custom meta field for users called "user_ein". It looks like an integer but is a string of number and it can start with the number "0". I have the following code in a ...
4
votes
1
answer
44
views
Disable - Post search field - for non-admin roles in WP dashboard
How can you disable the post search field "Search posts" - for non-admin roles in WP dashboard?
Image attached:
In my case, the non-admin role is a customer. The customer cannot and must ...
1
vote
0
answers
51
views
Wordpress Search - Reject partial matches
I'm currently looking into a solution for a project i'm working on where I would use the basic WP Search (the S attribute to a WP_Query) but it would need to only return full word matches (and reject ...
0
votes
0
answers
15
views
Search results stuck on page 1
The problem statement
For some reason when the user does a search the results page (search.php) only show the first page results. The pagination (next and previous links) also believes its on page 1.
...
0
votes
0
answers
9
views
Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles
We have a live search product bar on our website, which sits in the right hand sidebar on desktop versions, and we have some custom css which places it at the top on mobile devices, as it would ...
0
votes
1
answer
40
views
Woocommerce - Include custom user meta in order 'filter by registered customer' Ajax search
I am trying to include a users custom meta named 'sageaccountnumber' within the 'filter by registered customer' section of the WooCommerce orders list as shown below:
I already have the custom meta ...
0
votes
0
answers
11
views
How to make wordpress Dynamic Search-icon from Predesigned Static Html Search-icon?
<div class="hdrLogo">
<a href="<?php echo get_site_url(); ?>"><?php the_custom_logo(); ?></a>
</div>
<...
0
votes
0
answers
17
views
Custom Search on media files PDF images pages posts
Hi all – hoping to find a code solution for developing a custom search bar in WordPress that searches for both Posts/Pages but will ALSO search for media files such as PDFs and images. Basically I ...
0
votes
0
answers
6
views
"feed" added at the end of my URLs
In "crawled - currently not indexed" there are a few URLs that end with "/feed" resulting in a 404 error or a coded page preview for example "https://everyfootball.com/al-...
0
votes
0
answers
15
views
Search keyword store in custom meta key
I have search field with my custom post. Now I want, when people search i will store the key into custom meta value, How can i do that.
function eazydocs_search_results() {
$posts = new WP_Query( [...
0
votes
0
answers
20
views
Woocommerce ajax search can't work on mobile
It's wired my ajax search code can work on the desktop, but in the mobile browser, the ajax search doesn't have any responses. I don't know how to get the trick.
html
<input type="text" ...
0
votes
0
answers
83
views
Making ACF fields appear in search results
ACF fields return blank in search result excerpts, using the latest version of WP and GeneratePress. I am not concerned about the actual field being searchable, I just want the fields to display in ...
0
votes
0
answers
34
views
Dynamically added text at bottom of article - non searchable by PHP code
I need to move certain articles on my website, all of them, to another unique category. I am using specific phrase which is at bottom of every article, but after code execution, only two articles are ...
0
votes
0
answers
31
views
Search query alteration not working for meta values
The bellow code works on category archive pages, it filters out the necessary products. But on the search page it doesn't work. If I uncomment the line //$query->set("s", "chelsea&...
0
votes
0
answers
20
views
Search results truncated
If I look at a normal list page on my blog (like frontpage), all the posts are displayed in full. When I search, the posts are truncated.
Is there a straight-forward way that I can make the search ...
0
votes
0
answers
17
views
Non english characters in search bar
I have a problem with non-english characters when typed into the search bar (Polish characters to be exact). When searching “Sprawdź” for example the URL converts to “/sprawd%25C5%25BA/” and just ...
0
votes
0
answers
21
views
How make Autocomplete with wp_query in post_type attachment
This is my list of arguments to search for the attached files and I need to make it take references, for example, if my file is called banner, when placing the letter b, said file and others that may ...
0
votes
0
answers
28
views
Attached file how can i work the wp_query to search for related names
hello everyone I don't understand how to make my query work for related words and so I look for "X" image for example I have 3 images let's say one is called banner, another show and another ...
0
votes
0
answers
31
views
Filtering product search results using tags
Initially I tried just appending the tag in the url:
https://test.com/?s=test&post_type=product&tag=slug
This ended up returning 0 results, despite there being products that would match these ...
0
votes
0
answers
15
views
AJAX loading with custom parameters
I have a CPT set up with some custom taxonomy and I've created some custom searching functionality that works great with it, ( a user can search by keyword, industry, specialty, location, or all 4 or ...
0
votes
1
answer
32
views
Why custom search engine only searches in post titles of custom posts?
I am working on a custom search engine for a custom post type (articles) with custom fields in WordPress PHP (online magazine). It works almost fine, the only problem is that somehow the search is ...
0
votes
0
answers
76
views
Using 'meta_query' with the 'pre_get_posts()' hook disables searching for post titles
I tried using only the pre_get_posts() hook to add some custom fields to the default posts search. But it didn't work. With the code below, excepting the last code line, neither titles, nor content, ...
0
votes
1
answer
12
views
How can I make a search term redirect to a page
I'd like users to enter a unique number such as "756463" and it take them to a specific page.
How can this be done please?
0
votes
0
answers
38
views
Exclude category in search results in functions.php
I am attempting to write a function in wordpress 'functions.php' with the classima theme. The problem I am having is other posts being excluded from the search when I use the category filter. I just ...
0
votes
0
answers
65
views
Search and filter with custom field in taxonomy
I have created additional fields for myself in taxonomy. Now I would like to do a search using the values entered into them. I have a problem with this. What is wrong here and how should it be?
I'd ...
0
votes
0
answers
28
views
Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the "users search" input box
Update: A solution for this question was provided byt @t31os_ here Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users ...
0
votes
1
answer
130
views
Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users search" input box
I have been looking to extend the ability to search users in the backend for some time and have tried variations of several functions recommended in these articles and posts along with others not ...
1
vote
0
answers
20
views
Adding attributes to the core search block form
I'm trying to minimally hook (via a plugin) into the search form generated by the default search block and add a target="_blank" to open the results in a new tab. I'd much prefer to do this ...
0
votes
0
answers
19
views
Use wordpress search hooks to search a second database
My wordpress site helps navigate a secondary database that has 9000+ records. I want to use the Wordpress hooks so that my database is searched in addition to the wordpress database of pages and posts,...
0
votes
0
answers
28
views
How do I provide a search form for a specific post type, that is capable of searching within custom fields of the specified CPT?
I'm building a site that will have four post types:
The default 'page' and 'post' post types. And two custom post types.
The two custom post types will have custom fields and custom taxonomies.
I'd ...
0
votes
0
answers
12
views
Wp admin: I need search meta key from table wp_usermeta in screen custom post type
In screen custom post type.
Custom post type is: "phone_history_list"
I have column: "name" → Value of column "name"display from field "meta_key" is "...
0
votes
0
answers
21
views
The search doesn't work properly
The search page, gives results that are sometimes irrelevant. Here is "search.php" :
<div class="list-posts">
<?php if ( have_posts() ): ?>
<?php ...
0
votes
1
answer
45
views
How do I create a search form that searches only within a custom post type?
My website has a custom post type.
I'd like to allow users the ability to search within the custom post type. So I'd like the search results to only include posts of that particular post type.
I'd ...
1
vote
1
answer
39
views
Wordpress search results grouped by post type
I've been struggling to make it work. This code works and returns post_type title and post titles inside it. I found it here
But i need to have some sort of formatting and excerpt. Currently I cannot ...
0
votes
0
answers
17
views
Sort Search Results in Order of/by Character @ count (9) of post(s) title. (Ocean-WP theme)
I'd like to order Search Results by the 9th character of Post title.
Example) Search Results Page:
Current Order:
123456 - B Post Title;
678901 - A Post Title;
789101 - C Post Title;
891011 - 1 Post ...
0
votes
0
answers
8
views
search videos on divi builder
I am a wordpress noob and I have to make a website where I have to be able to search 100s of video names so their links can be accessed. what type of module should i use (post/blog/regular text) to ...
0
votes
0
answers
45
views
Search results always returns "No results" no matter what
pre_get_posts hook that never works
I used the following code both in functions.php of my theme and in my custom plugin in the "after_theme_setup" hook (pre_get_post code only as it is alot ...
0
votes
0
answers
20
views
Wordpress WP_Query Search ('s') With Multiple Search Terms
I have built a product filtering functionality in Wordpress using the WP_Query object which includes the use of the s Search Parameter.
This could be something like "ring" or "necklace&...
0
votes
1
answer
21
views
Two Querys in one Search - Category-Tag nightmare - HOW?
Dream scenario:
User searches for at state (post tag) to find a relevant service. Every state has its own tag and category. If no service (post) is found a text pops up - something in the region of &...
0
votes
1
answer
20
views
Page not found: Custom search form with a custom search page
Let me show you an example of what I'm trying to achieve. On BBC website when you click the search BBC button on the navbar it brings you to a search page (https://www.bbc.co.uk/search). When you put ...