Questions tagged [search]

The method by which users find information on your WordPress site

Filter by
Sorted by
Tagged with
0
votes
1answer
8 views

Finding a page holding a specific string/URL that is used in the content

In my situation do I want to find pages that have a URL in the content of the post that is redirecting to a 404 page doesn't exist. I want to able to search for this URL and find on which page(s) it ...
0
votes
1answer
32 views

Why should we use the name attribute with the value “s” in the creation of the search form?

I was doing a search form when I realized that if I change the value of the name attribute to something other than "s", the search.php page will not be displayed. How can I change and still display ...
0
votes
0answers
59 views

How to create a custom filter in Wordpress?

I am creating a e learning site where i want provide my visitors a functionality to get the results which they need . Suppose a visitor needs to find the colleges in a particular location. So I ...
0
votes
0answers
92 views

Wordpress search post using unicode

I'm working with wordpress rest api I need to searching WP posts with unicode character example searching on my site: https://example.net/?s=ngoại+tình The results is OK The I applied to my api : ...
1
vote
0answers
175 views

Extend product search with meta in WooCommerce

I would improve the search bar in order to exploit manufacture attribute linked to product. I try to use this to filter product by a custom meta (no product attribute) function custom_search_query( $...
2
votes
0answers
101 views

Extend 'The Events Calendar' search to include custom fields [closed]

I am using the following code to modify the default WordPress search and The Events Calendar search to include custom fields. The custom fields are added by the Advanced Custom Field (ACF) plugin (...
0
votes
0answers
147 views

How to debug none working search query?

I'm developing an website that I didn't built the foundation for. When I try to implement a simple search query I just get nothing in response. There is no errors showing up in normal php error ...
0
votes
1answer
345 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
45 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
2answers
669 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
1answer
21 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 ...
1
vote
1answer
2k 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
63 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
1answer
348 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
20 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
2answers
55 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
vote
4answers
628 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 ...
1
vote
1answer
231 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
1answer
146 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
163 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
1answer
50 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
22 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
1answer
73 views

how to disable autocomplete search on wpLink?

how to disable autocomplete search on wpLink?
1
vote
1answer
199 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
72 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
37 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
90 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
165 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
33 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
1answer
235 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( "#...
1
vote
0answers
156 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
126 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
1k 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
49 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
591 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
0
votes
1answer
33 views

Custom search for a custom post type in WordPress

I have created a custom search for a custom post type in WordPress that searches car vehicles. I can search by manufacturer and model but I want the search to be flexible and show results based on any ...
-1
votes
1answer
22 views

Want to creat a search for my wordpress theme [closed]

im new in wordpress , i've made my first theme and i need your help guys , i want to creat a search for my theme this is my search form : searchform.php <div class="search-home"> <form ...
1
vote
1answer
39 views

Redirect All Search Links Containing - to + on Wordpress

I deleted all my wordpress tags via phpmyadmin, and most of my post content contains tag links, now I redirected all the tag links to search using .htaccess, I.E example.com/tag/stack-exchange/ ...
0
votes
1answer
22 views

How can I change my search form to bring up product results, not blog results

I'm currently building a wordpress/woocommerce site using a template, and am having issues with the search form & results. When using the search bar, results come up with the title 'blog', and ...
0
votes
1answer
58 views

Trying to remove plural 's' from search Query but it's just removing every letter of the end - what am I doing wrong? Thanks

Trying to remove plural 's' from Woocommerce search Query but it's just removing every letter of the end - what am I doing wrong? Thanks function mySearchFilterFunction($query) { if ( !is_admin() &...
0
votes
1answer
25 views

Query posts that have all the specified tags

I have tried this one for example: $query = new WP_Query( array( 'tag__and' => array( 37, 47 ) ) ); It doesn't seem to work. Am I wrong in thinking that category and tags are the same relative to ...
0
votes
1answer
43 views

the_excerpt displaying code inside style tag

I created a custom visual composer element where I included a style tag on it to use the chosen color to create hover effect. And this code is now displaying in the the_excerpt in the search result ...
1
vote
1answer
35 views

Combine multiple words in custom meta search query

I'm trying to create a custom search for my bookstore. I have two custom meta fields called vbs_author and vbs_publisher which hold the name of author and publisher of that product (book). So far ...
0
votes
2answers
636 views

Slow Query On Search

Please I have a very slow query on my wordpress search, checking the processes it takes upto 40sec to execute using SHOW FULL PROCESSLIST; below is a sample of query SELECT SQL_CALC_FOUND_ROWS ...
0
votes
1answer
317 views

Woocommerce wp-admin search products through custom meta value too

Right now I can search only through title and content. How can I search also through a custom meta box value?
1
vote
0answers
20 views

Use “search” in permalink?

I am currently in the process of migrating a custom web app to WordPress and in the custom app, search requests have a URL structure of mydomain.com/search?q={search criteria}. I attempted to add ...
0
votes
1answer
17 views

Search transients through widget

I have a certain amount of data stored in a transient through a custom developed plugin ( just for this one website ). The transient contains one big array of data that I get from an external API. The ...
4
votes
4answers
3k views

WordPress post sorting with AJAX

I am having a search result page for custom post type. I want to have a ajax sorting feature. Eg sort the post by taxonomy without reloading the page. A very basic example will help. Thanks The ...
2
votes
1answer
116 views

Restrict a search to a custom post type

I have a search form in the home page and search form in the sidebar. Is it possible to make the search form in the home page show results as per a specific template and make the sidebar search form ...
0
votes
0answers
71 views

Why is there a 404 on page 2+ for my search page?

I've overridden the search.php template from within a plugin, and I've replaced the global $wp_query with a different one, and without any paging parameters it works fine. Once I add a /page/2/ on ...