People who code: we want your input. Take the Survey

Questions tagged [search]

The method by which users find information on your WordPress site

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Display the full content of a post in the search result page

For my website, I want the users to search for their pdf reports (using their report ID, which will be the same as the name of the file), i.e., the user has to enter the exact report ID to get their ...
0
votes
0answers
16 views

How to display the full content of a post in the search result page?

For my website, I want the users to search for their pdf reports (using their report ID, which will be the same as the name of the file), i.e., the user has to enter the exact report ID to get their ...
0
votes
0answers
23 views

how to get product if title does not match try to search in categories or tags

I want to search the product If the title doesn't match then query string search in categories and tags. I wrote a query for the same but can't able to handle OR operator results are returing with AND ...
0
votes
2answers
873 views

Form search query - displaying ACF “Post Object” field as results

I will try to summarize as simply as possible my request. I have a custom post type (CPT) called “job”. This custom post type includes 3 fields : The title (the native wordpress title field) / ...
0
votes
0answers
15 views

Yoast highligh custom search result

Maybe someone in the WordPress community can help me with this. I am using Genesis with WordPress and I have created some functions with the help from others on the internet to make custom search ...
0
votes
1answer
34 views

Get search result count in plugin

Is it possible to get count of search results in plugin? I tried to use pre_get_posts action, but post_count always returned 0. I need to know if there are any search results and if not, then do ...
0
votes
1answer
83 views

How do I exclude a specific page (and child pages) from the search results?

How do I exclude a specific page (and child pages) from the search results? I've seen posts showing how to exclude all pages. I don't want that. I want to target a page and it's children and exclude ...
0
votes
0answers
11 views

How do I create a button, that when clicked, will navigate to my woocommerce store page and automatically apply specific attribute search filters?

How do I create a button, that when clicked, will navigate to my woocommerce store page and automatically apply specific attribute search filters? The tools at my disposal are Divi for front end, ...
0
votes
1answer
18 views

Showing search results on a page

I am building a company directory for a website with business news. Now what I would like is to add pages of companies with some common information and a list of published posts about that company. So ...
0
votes
1answer
25 views

Redirect Search to Form When No Product Results Are Found

Site has an internal product search. If a query has no results, I want to redirect to a contact form, and pass the query through into the form into the product name field. The problem I'm having is ...
0
votes
1answer
53 views

How to properly use AND / OR in custom search

I have a text field and a drop down with country names. If I use OR and only fill in the text field with a person's name it brings back incorrect results. If I type in the name and select a country, I ...
1
vote
1answer
28 views

Replace/Mute/Stop Search Query

I'm trying to replace the search functionality in WP. I've already created the search.php template with all the results I want to display. I don't want any results from the WP database. I just want ...
0
votes
1answer
77 views

How can I modify the CSS only for the search results page of Wordpress?

I use the wordpress theme Sensible WP. When I do a search this is what appears as the URL: https://www.example.com/?s=my+search+text I need to modify the CSS for this page only, not all pages, but I ...
0
votes
0answers
42 views

Redirect empty search to another page

I am using the following code to change the url of my search results page: function wpb_change_search_url() { if (is_search() && !empty($_GET['s'])) { wp_redirect(home_url("/suche/...
0
votes
1answer
102 views

Search to include external content

I am very new to Wordpress and PHP in general having mostly worked on .NET CMS systems in the past so please bare with me. So, we have a Wordpress site that uses Advanced Custom fields, and Polylang ...
0
votes
1answer
353 views

How to exclude woocommerece product category in search results?

I'm looking for a way to exclude a product category from search results with Woocommerce using the pre_get_posts action and $query->set(). I am searching using the Wordpress ?s=keyword search. I know ...
1
vote
1answer
648 views

How to display search results in search.php

I am trying to display search results in search.php , but no results showing. it just show this search results for: then the keyword I put in the search box only nothing more. so the actual results ...
0
votes
1answer
27 views

Prevent A Specific Custom Post Type Showing In WP Search Results Page

I've excluded certain pages from the WP Search with the code below in my functions.php file. I also need to exclude a custom post type called 'sites'. I can't seem to find the custom post type ...
0
votes
1answer
117 views

Using ElasticSearch on Wordpress

I am a noob so appreciate your patience :-) I am trying to use ElasticSearch with a Wordpress installation using the ElasticPress plugin. All configured and in production. Amazing results so far. ...
0
votes
2answers
738 views

pre_get_posts and search query for admin

I'm going round in circles with trying to include several custom fields in my search results. The custom fields are managed via ACF. At first I want this for the admin. /wp-admin/edit.php?post_type=...
1
vote
1answer
401 views

Admin search not working for any type of post

Wordpress admin search is not working for any type posts i.e posts,pages,comments or any other custom posts. Whenever trying to search for say string without quotes "my new post"** it always returns. ...
1
vote
0answers
28 views

Check for taxonomy archive on search results page

I'm looking for a conditional tag to check if a taxonomy archive page(link) is displayed on my search results page. is_tax(); only seems to check if the current page is a taxonomy archive page and ...
0
votes
2answers
227 views

Woocommerce Multisite global search how to mod ajax function?

I created an installation of my multisite ecommerce to differentiate the men's and women's departments. Often, however, it happens that in the men's department they do research related to women's ...
0
votes
1answer
36 views

Search results - 404 error after hitting enter

So I am using a theme from envato and there's extremely poor response from the support team and I hate not trying things on my own. On the website I am working on right now there's a problem with ...
0
votes
1answer
42 views

Redirect wordpress search query if its a tag

i have modified this function to make it redirect search query if it a tag example if searchQuery='football' then redirect to /tag/football/ function redir_search($a) { if (is_search()) { ...
0
votes
0answers
31 views

Search in WordPress

I created this function in functions.php: function wpbsearchform( $form ) { $form = '<form role="search" method="get" class="searchform" action="' . home_url( '/' ) . '" > <div>...
0
votes
0answers
209 views

Redirecting wordpress search query to archive page

My sincere apologies for asking this question as I am quite certain that this is a relatively easy topic, unfortunately my many hours of searching got me no satisfying results. I do not mind ...
0
votes
1answer
30 views

How to exclude specific post_type from default search?

I'm trying to exclude WooCommerce products from default WP search, but I need to keep all other posts types, including CPT and those CPT created in the future. Im trying with: function searchFilter($...
1
vote
1answer
96 views

Is there a way I can find wordpress posts that don't contain a word?

Am trying to unpublish wordpress posts that don't contain a word., Its like the inverse of search, Search is finding a string in wordpress posts, I need to find wordpress posts,. I think this will be ...
1
vote
1answer
105 views

How to loop for every result found in the_content() when using the search query?

im doing a custom search result page with function that extract from the_content() some words before and after the search query. (Eg ?s=cool result=[...sterday was cool and the par...] It's working ...
0
votes
1answer
14 views

Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?

I am creating an educational website and some of my pages are "subjects" like math, physics etc and I want them to be searchable. How do I do this? I thought that it would be easy if I just made a ...
0
votes
1answer
31 views

Send admin an email when a user's search has no results

I'm new to WordPress. What is the easiest way to trigger an email to admin when a user's search has no results.
1
vote
2answers
57 views

Standard Wordpress Search does not work / Search-results are not displayed / Custom template

My search-results are not displayed. Instead searches show a 404. See https://startupsagainstcorona.com/solutions/ for testing. Can someone help? What did I do? I implemented the standard WP-search ...
1
vote
0answers
16 views

Find user by nicename and open profile

I want to add filter function and show user profile page by using search form. This is what I have now: function test_where_filter($where){ global $wpdb; if( is_search() ) { $search= ...
1
vote
0answers
32 views

Is there a link parameter that will show me all my published pages?

Is there any way to display a loop of all the pages that are published on my website, via a link? (Even while logged out) For example, I can type in domain.com/?s=text and that will create a post ...
1
vote
1answer
264 views

How do I use a block to display search results?

We are using the search gutenberg block on a new gutenberg site for our search form, but can't figure out which block to use on the search results page to display the search results? https://github....
1
vote
0answers
23 views

Making custom field serchable in woocommerce [duplicate]

I have a product field which is by default in the woocommerce and i have added another field custom field (ACF) which is stock_number on my product/shop page i can search for products by title only i ...
0
votes
0answers
30 views

Help me understand how Search function works using dynamic_sidebar()

On my existing website, there is a search box at the top of the page. My understanding is that it's from this code in header.php <div id="search_sec"> <?php dynamic_sidebar('search');?&...
1
vote
1answer
280 views

Get PDF in media by ID

On my search page, I've added all the file from the media with this code : function attachment_search( $query ) { $args = array( 'public' => true, '_builtin' => ...
1
vote
0answers
21 views

Separeting product from post in search result

I am trying to separete products from posts in the search result. I can see the loop there search in both. if( have_posts() ) { while( have_posts() ) { ...
1
vote
0answers
13 views

how to create search and filter form generating “plus” symbols in url in between category names?

How to create search and filter form to use multiple categories and tags checkboxes? I'm tried to do it standard way, but it gives me wrong filter results &categories=vitamins&types=gainers&...
1
vote
1answer
49 views

what are the checksums surrounding keywords in the SQL generated by WP_Query and do I need to use them too?

I am using posts_join and posts_where filters to include a custom table in a query. this page says I should "use whatever WordPress did to search the post title field to search my custom table fields ...
0
votes
0answers
147 views

Filter admin ajax data by url query

I am new on ajax query, How can I filter admin-ajax data in the URL query? I am working on a search page where I am getting all the WordPress user data from admin.ajax.php, that is working fine. ...
0
votes
1answer
1k views

Filter WP user acf field by ajax

I have a search page where search result of user is displaying by postal code or county name. while on the search page i have checkbox to filter user by attribute like developer, designer, and account,...
0
votes
0answers
25 views

Creating a custom WP query for a Custom Post Type

I'm trying to create a WP query to search a Custom post type by its title. By using the following code, I get all portfolio posts: $search_query = array( 'post_type' => 'portfolio', '...
0
votes
1answer
54 views

What is the correct way to search 3 custom fields only in WordPress?

I have three custom fields (not using ACF). I want the search form to search for a match in: _cth_featured_zip_code_1 _cth_featured_zip_code_2 _cth_featured_zip_code_3 This is the query I've ...
0
votes
0answers
24 views

In the php, how can I have a category of a custom post type display?

It's for my search page on my site. I would link it but it's not up and running yet so hopefully, I can explain. I have custom post types that are then broken out into categories. I want, when ...
0
votes
0answers
34 views

Search Function not searching correct custom_post_type even though post_type is defined in search args

I have a custom post type of job_listing and a custom_post_type of job_application. Each job_application post has a parent within the job_listing post_type So if a job listing for an Office ...
0
votes
1answer
25 views

Is it possible to show subdomain posts in main domain search result?

I want to show subdomain posts when visitor search something on main domain. How can i do that ?
0
votes
1answer
40 views

I wan redirect link post search to search product woocommerce?

Search results link for the post : https://domain.com/?s=item+item I want when clicking search, the article search link automatically redirects to the product woocommerce search link is: https://...

1 2 3
4
5
35