Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [search]

The method by which users find information on your WordPress site

0
votes
1answer
23 views

Modifying post content with the_post action hook

I'm trying to understand the best way to modify the way that search results are displayed with my custom post type. I've got the search function working properly and giving the correct results and now ...
1
vote
0answers
8 views

How to search Woo Commerce products with punctuation in title?

How do I modify the default WooCommerce Product search so that products with punctuation in the title can be found without including the punctuation in the query? For example, if I have a product ...
0
votes
0answers
9 views

Add category to curent category filter - link

I want to place a link to a category (cat2) on the page MySite.com/category/cat1/ that takes you to MySite.com/category/cat1+cat2/ But if you already are on MySite.com/category/cat3+cat1/ I want it ...
0
votes
2answers
20 views

Adding id and class to the search input in WordPress search form

I want to apply the AJAX feature to the WordPress custom theme for search. And I need to target the input using id and class. I didn't find any tutorial on adding id to the premade WordPress search ...
0
votes
0answers
17 views

Can't enable autofocus in search input [on hold]

I made a div for a search field and used a JS code to make it appear from the top by clicking on an icon in the navbar. I would like to enable autofocus in the input, but it is not working. I'm using ...
0
votes
0answers
12 views

Create a search to search data from a page, not the whole site [on hold]

How can I customize a search bar in WordPress where it doesn't have to search a string from the whole website, but only data from a particular page?
0
votes
1answer
9 views

search results in custom template search.php

right now i have a problem in the search result page (search.php) the result is shown by the index page template not its template and it display all the posts despite it have what the searcher enter ...
0
votes
0answers
27 views

make search result pages only

hello every one i have a project right now need when i search for something the result is only pages (no posts) i have tried many thing but nothing work i even trash all my posts but the search result ...
1
vote
1answer
44 views

hook to get (and change) the search string before processing

I'm trying to intercept the search query before it's executed in Wordpress. I've tried a bunch of things but it's just not working. So, for example, a user enters the search term RED SHOES. I want ...
0
votes
1answer
25 views

Search returns “Nothing Found” on a sub directory

I've created a multisite using subdirectories. The search function, both in backend and frontend, only works on the main site. If I try and do a search in a subdirectory it returns with "Nothing Found"...
0
votes
0answers
21 views

Woocommerce Custom Search based on category not showing

Here i am explaining perfectly. I have created a custom search with category in woocommerce. It was working fine but has an issue. I am having a product which has two category. 1. Women 2. Accessory. ...
0
votes
1answer
13 views

getting posts by tags

i use below code for getting posts by word tag $search_songs = array( 'posts_per_page' => -1, 'post_type' => 'songs', 'tax_query' => array ( array ( ...
0
votes
2answers
17 views

How do you determine if a result in a search query is a post or a page?

I thought this question would be an easy find on the internet… however, it seems no one has ever ran into this issue before. There's no problem in listing a search query when you enter your search ...
0
votes
0answers
17 views

Return any exact match first, then all other search results

I'm trying to modify my search.php page to return any page/post that matches the search terms exactly, followed by all other results that a standard search would return. I'm currently using the ...
0
votes
1answer
17 views

Remove gray header on Search Result page on Wordpress

I'm new here, and new using Wordpress I'm creating a website, https://www.maispersona.com and I'm trying to modify my search page layout. (You can get into the website and search something to see) I'...
-1
votes
0answers
11 views

Limit search to category, post titles, metas, post types and tags only

Can i limit the search to post titles, tags, custom post types field and category only without plugin, if yes can i get a code to put in function.php Thanks for your help, if any?
0
votes
3answers
29 views

Add custom post type archives to search results?

How do I get WP search results to include custom post type (CPT) archives? For example, if I have CPT 'career' whose title (in the template php) is 'Careers', how do I get search results to include ...
0
votes
0answers
8 views

Redirect Search link to specific Category search

I simply want to redirect all search link on my post to custom category search. E.g I have a category named WordPress, and content of the posts on that category already contains links to search ...
0
votes
0answers
12 views

Search by Category With Custom Search

Please help me out, Is there any way I can make a custom wp search to work on category? already I have a custom search with /search/ permalink. But it does not work on category it only works on ...
0
votes
0answers
16 views

Custom Search Not working in Specific Category

Please I have tried my best but to no avail, I want to limit search to specific category, but its not working. before now I customize my search permalink from example.com/?s=keyword to example.com/...
0
votes
1answer
22 views

Include woocommerce custom field value in front-end search result

currently the search result only showing all the woocommerce default product field (product title, category, tag, .etc). I've add a new custom field inside the woocommerce product using this code ...
0
votes
0answers
29 views

WP_Query Not Searching Custom Post Type

I was hoping to get some direction on an issue I am encountering. I'm digging through bugs on a website that has been left alone for quite some time. I did not write this function, I am just trying ...
0
votes
1answer
20 views

WordPress does not find author pages in search

I have created a custom child theme based on twentytwelve. I assumed that searching for 'Addy' should return results, as I have an author named 'Addy'. Url is here: https://www.nvk-keramiek.nl.
1
vote
1answer
25 views

Only show search results with if current date is between two dates?

I have a custom post type which I can set a start and end date in the metadata. I use the function below to filter the search results and only show results from the post type visitor: function ...
0
votes
0answers
7 views

WordPress search disable all the links after I click on it

I hope my issue is clear. If I'm in my page and try to use search, all links after it gets disabled, the buttons don't click. Anyone have an idea about what happens?
0
votes
1answer
27 views

Search only for posts with specific metadata?

I have a custom post type which creates events. These events have a start date and a end date. I want to be able to search for the events which occur on the specific day only. So if start date is 2018-...
0
votes
0answers
17 views

Prioritise search result to show matching result from title first WordPress

I am trying to customize the WP search and want to show all post first which has search keyword in the title and then show post having search keyword in the description. I want it to be done using WP ...
0
votes
0answers
25 views

How to prevent urlencoded querystrings in custom search forms

When searching using WordPress's default site search, URLs appear with pluses for spaces and punctuation is maintained. For example searching for foo bar, foo bar using: <form action=""> <...
0
votes
0answers
21 views

Where to find child themes?

Is there a method of finding child themes? I tried searching the Wordpress Theme Directory, but most themes do not seem to have children. Some featured in the "Twenty Fifteen" search actually are ...
0
votes
0answers
6 views

wordpress search function works for admins but not users

I keep getting the error "Unauthorized. You may remove the customize_messenger_channel param to preview as frontend." The pages I'm searching for are published. anyexpat.com is the site with the ...
0
votes
0answers
39 views

how to disable autocomplete search on wpLink?

how to disable autocomplete search on wpLink?
0
votes
0answers
39 views

How to remove search bar based on page template

Currently, the search bar is a widget in the primary sidebar. I want to remove it from all pages except those using a specific page template (let's call that template "searchable.php"). My most ...
0
votes
0answers
14 views

Pagination on Search Query not formatted correctly

I have in my pagination code below I have seemed to figured out how to omit the /page/1/ from the first link of my pagination like this 'base' => get_pagenum_link(1) . '%_%', on news posts and ...
0
votes
0answers
36 views

How to create different search filter for each product categories in wordpress

I have a shop in wordpress with different kind of products. I am going to create an advance product search filter in sidebar and for this purpose, I would like to use different search terms for my ...
0
votes
0answers
14 views

Strict search with ElasticPress

After installation of ElasticSearch + ElasticPress my website working much faster. But my search results looks strange, when I'm trying to search by meta. I'm using Advanced Custom Fields and include ...
1
vote
1answer
24 views

Use wp_get_recent_posts with search term

I have a function that uses wp_get_recent_posts() I need to use this same function on my search page but am having problems adding the search parameter to the $args array. Does anyone know if this ...
0
votes
1answer
18 views

How might I go about using the API to search for a user by email, but ensuring that it is an exact match?

I am using the API currently to search for a user by email and then getting the ID if the user and then executing a change to the account based on the ID. The only issue is, it seems that when I ...
0
votes
1answer
16 views

Custom Search form not working in localhost

This was the solution that i got from @Ray Gulick for having a custom search form for custom post type. This works fine in hosting service but fails in localhost as the form action is added as action=...
1
vote
0answers
21 views

WP Query Args - Title or Taxonomy Value

How do I query by tax_value or title? I have $args = array( '_meta_or_title' => sanitize_text_field(preg_replace('/%20/', '+', $query[1])), 'posts_per_page' => 100, 'post_type' =&...
1
vote
1answer
24 views

How to search CPT's by meta query from the admin dashboard?

I feel like I'm missing something really obvious, but I've looked and can't figure this out. I have a CPT (request_form) and I need to perform searches on meta queries (wp_postmeta) rather than the ...
0
votes
1answer
17 views

Add to search posts query array with post IDS which will appear first

Is there a way to add array of post IDS to set posts to be on top of search results? Something like adding a param top_post_ids inside the search hool: $query->set( 'top_post_ids', [45, 78, 94 ] )...
0
votes
0answers
15 views

Wordpress Search across media files

How can i extend the wordpress default front-end Search to search across audio file titles/captions as well?
0
votes
0answers
8 views

Multisite Search by custom taxonomy

With multisite, each blog has its own table. I want to create a plugin that will add custom taxonomies to all blogs. I know how to do this. Then I want to create a query to return all posts for a ...
0
votes
1answer
54 views

How do i search post by jquery datepicker?

I'm working on the WordPress website I have my own search filter page, where I added the jquery datepicker, now I want to search post by datepicker? Html Code script> $(function() { jQuery( "#...
0
votes
0answers
25 views

How to search by title or tags exclusively?

I would like to modify the default search query of Wordpress to be able to get results from searching exclusively by tags or title. Meaning, it would show posts that contains a match from either the ...
0
votes
1answer
35 views

Wordpress search form and input type=“image”

I need help with this code. How can I get the search field to display when clicking on the search-icon.svg? <form role="search" method="get" class="search-form" action="<?php echo home_url( '/...
0
votes
1answer
40 views

Custom Post Type WP_Query with filters and search

I have a custom post type called "doctor", this is the query I have set for displaying all the posts in the archive template: $args = array( 'post_type' => 'doctor', 'orderby' =...
0
votes
0answers
26 views

is_search is returning false even though search.php exists

I have a problem even though search.php and searchform.php exist but when I search for words, nothing is displayed. I var_dump(is_search()) and it returns false. Anyone had this problem or help how to ...
0
votes
0answers
23 views

Search, pagination, the last pages leads to 404 page

sorry Im new to Wordpress. I have a search list and able to browse among hits: "http://example.com/search/SEARCHEDKEYWORD/page/11/" I have 15 pages, and the last 3 pages leads to 404 page. So, http://...
0
votes
1answer
28 views

Show total sales for each products on search results page Woocommerce

I customize my search results page like this when show the results as shown in the picture at the bottom I want to show total sales for each products on search results page