Questions tagged [search]

The method by which users find information on your WordPress site

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

WordPress Search return wrong results

i limit the search in my WP blog to be within post only by adding this line <?php if (is_search() && ($post->post_type=='page')) continue; ?> So any results from static pages will ...
0
votes
1answer
1k views

Include images from pages in wp search.php results in default wp search

Is there a way to include page images in wp search? Like I want to search through my sites images on pages not in posts by caption/alt text and display them in the results page as thumbnails.
2
votes
1answer
856 views

How to add additional search terms (e.g. synonyms) to the search?

I'm running a blog about different software tools. I frequently use the search to find articles that I wrote for the blog. I also wrote an article about latexdiff, but always forget the name and try ...
0
votes
0answers
10 views

Text input field for filtering custom post type in custom archive page

I made a glossary custom archive for a custom post type 'words' and I'm trying to add a search bar/text input field that will filter the words and only show the ones that have the ...
0
votes
0answers
10 views

Search results page title when taxonomy chosen in filter

I have a search form which includes a filter for 'post type', 'sector', and 'region' plus a text field for searching whatever words a user wants. 'Sector' and 'region' are custom taxonomies. Currently ...
1
vote
1answer
3k views

How to filter my search in post if contains a word in title, content or excerpt?

I'm trying to filter one search, and I'm interested in know if a word is inside the title, the content or the excerpt but without luck and finally I'm stucked. $args = array( 'post_type' =...
0
votes
2answers
35 views

Add a searchbox to the body of a page

I'm creating a website in which I need that, when I click on one of the tabs of the specific menu, and it opens, this page contains a search box in its body. My question is how can I add this search ...
0
votes
1answer
2k views

How to search through “post title” and “tags” using WP_Query?

In my custom search form, i'm currently using these kind of $args with my WP Query: $args = array( 'post_type' => 'post', 'posts_per_page' => $postsPerPage, 'offset' =&...
0
votes
1answer
28 views

Wordpress custom search only works from some pages

UPDATE: 06/07/21 - I managed to reach out to the Dev who found the answer, in case anyone else even has something similar. See answer in responses below. We had our site built by a contractor. That ...
0
votes
0answers
12 views

search form for custom fields

I want to create a custom search for pin code search with custom fields value. When exact match with pin code will show the post data Can you please help me? Any help in this matter would be ...
1
vote
1answer
914 views

Search by tag name and category

How can I return all posts that match a specific taxonomy using <?php get_search_form(); ?> For example: if a user enters a search query that matches the name of a tag or category, search.php ...
-1
votes
0answers
8 views

How to add custom search field in woocommerce

I'm trying to add a search field, on the products page, as seen on this site: https://www.netseals.it
6
votes
5answers
24k views

Remove meta robots tag from wp_head

I am in need to remove just this line <meta name=robots content="noindex,follow"/> from wp_head but can't find the right hook to use it with remove_action(). <meta name=robots content="...
1
vote
1answer
39 views

meta_query search names when they have middle initials

I have to build a search form where I search members of the company by their Full Name (First Name + Middle Initial + Last Name). All the names are in this form: John B. Doe The below code is working ...
1
vote
0answers
12 views

How to set up a pay-per-search / pay-per-query site with memberships? [closed]

I want to set up a website where customers can pay for searching a database. The idea would be that there are different types of memberships with different numbers of allowed searches in the database. ...
2
votes
1answer
1k views

Make Search Function include subdomain (blog.ourwebsite.com)

Wondering if there's a way to edit our search.php or .htaccess or function.php (or anything else...) so that our search function on our main site (www.oursite.com) includes the subdomain of blog....
1
vote
1answer
19 views

input data and output table [closed]

I need a solution to do this with WP. In admin: I need to input data into database (name, surname, certification, level, date of issue). In Frontend: client can use a specific search field to search ...
1
vote
0answers
11 views

Add Custom Search Box to WooCommerce [closed]

I am trying to implement a custom simple search box on woocommerce. It should not overwrite default search attribute. This search box will search for product SKU number and return result only if it ...
3
votes
0answers
1k 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 ...
0
votes
0answers
72 views

Excluding posts from search results page with meta query not working

On my search results page I have two loops. First loop displays post by meta value and second loop is "regular" loop that display posts by search query: <section> <div class=&...
0
votes
0answers
17 views

Search for custom field input of a custom post type in ajax live search

I have a custom post type (gd_place generated through GeoDirectory) with a custom field (select_funding as part of the table wp_geodir_gd_place_detail) where a user can choose one out of several ...
0
votes
2answers
2k views

Searching my on my blog is not working

I've been trying for hours if not a day to try and get my custom search.php and searchform.php to work and still no success. I've read a lot on these two templates and still no success. Here is my ...
1
vote
1answer
2k views

Search not showing all results

EDIT: So I've done some troubleshooting and it seems my theme isn't showing woocommerce search results. The 2017 theme does so I am trying to figure out what my theme is missing. I suspect something ...
0
votes
1answer
79 views

search custom post type by custom fields on front end

I want to add filter to my site and want to filter custom post type by custom fields for example i have a custom field with name country when a visitor enter a country it should show all custom post ...
0
votes
0answers
7 views

Include tags in ajax search

I have set up a simple ajax search in my theme more or less based on this Now I'd like to search through post tags and propose tags in the live search that fit the search of the user. I haven't really ...
0
votes
1answer
820 views

Searchable database of members using multiple criteria / filters

I'm very new to wp let's say that first! What I need is to create a site which will list a database of members of an organisation. Users will also be able to sign-up and add themselves to the ...
1
vote
1answer
19 views

How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?

While searching with the argument s it adds additional value before and after each Like query SELECT wp_7_posts.ID FROM wp_7_posts WHERE 1=1 AND (((wp_7_posts.post_title LIKE '{...
0
votes
2answers
2k views

Custom search: Search posts but display parent page in results

I'm using Wordpress 3.5.1 with a modified twentytwelve theme. My main site structure is based on the Smooth Slider plugin (jQuery Cycle). I have Pages that contain only a shortcode (for example, [...
-1
votes
0answers
19 views

Setup WP search to use POST method instead of GET

Is it possible to make the WordPress native search use the POST method instead of the GET method? If so, how would I go about that? I can't find any information on it online.
0
votes
1answer
2k views

Create custom query for search?

I have create search box using ajax.If i enter any value in search input box that this value search in post title or post meta data and get all data of this value in custom post type.also query check ...
0
votes
1answer
614 views

Create Second Search Page Only for Custom Post Type

I created a custom post type that will not be displayed anywhere on the site. However, I want to access the data from a search form. Because there will be a lot of pages, I need to disable the post ...
0
votes
1answer
623 views

wordpress ajax search posts

I tried to configure search area in wordpress using ajax, so i add this code into functions.php <?php // the ajax function add_action('wp_ajax_data_fetch' , 'data_fetch'); add_action('...
0
votes
1answer
567 views

Custom Search Query – include only custom fields and title

I have a custom post type and I also need a custom search. I want the post title and two custom fields to be indexed/queried. I found solutions for title only and for custom fields but not for both so ...
0
votes
1answer
35 views

How to combine two get_users() array?

The $q1 and $q2 are working well individually. if (!empty($search_term)) { $q1 = get_users(array( 'fields' => 'all', 'role' => 'contact', 'search' =&...
0
votes
1answer
10 views

Changing search slug from + to - (hyphen)

I've been fiddling with this all day, where I'm trying to change my search function from website.com/s?this%20is%20an%20example to website.com/tag/this-is-an-example to no avail. I have this code in ...
0
votes
1answer
633 views

How to Fix Form elements do not have associated labels in Wordpress Search Form (without button)

Is there any way to fix the "Form elements do not have associated labels" issue in WordPress search form without having the search button. Google Light House Audit: Form elements do not ...
0
votes
0answers
42 views

Rewrite Search URL Permalink For CPT Custom Taxonomies

My site uses a CPT with custom taxonomies and shows this URL for searches : https://example.com/?s=&post_type=listing&location=bridgeport&sale_type=for-sale&property_type=office But ...
1
vote
2answers
596 views

Using search.php without a 's' field in searchform.php

Sorry if this is a simple/daft question but I'm still getting to grips with how WordPress search functions. I want to completely replace the standard search within my template with a custom search ...
1
vote
1answer
646 views

Creating a Searchable PDF Archive of Publications

We are a not for profit association that produces a quarterly publication of about 45 pages. Want to create a members only archive of back issues in pdf format. This would be used for research (not a ...
0
votes
1answer
3k views

Custom post archive with search, is_search() is false?

I have a custom post type, and have created an archive template, archive-custom_post_type.php, which includes a search form. I am then using pre_get_posts to add parameters to the query to filter my ...
6
votes
1answer
1k views

Admin Area Custom Type Search By Meta Fields Without Title & Content

I have a custom post type that uses several meta fields. In the admin area I would like to be able to search by those meta fields. I have implemented this currently in my functions.php with this code: ...
0
votes
2answers
2k views

Adding thumbnail to search results & changing content.php

Looking to discover how to alter my content.php code to add the thumbnail image of the specific posts to my search results located here for example: https://divesummit.com/?s=suunto&submit=Search ...
0
votes
0answers
18 views

How to sanitize my GET string before using in post query

My question is about sanitizing user input data before using it. I am not very experienced in neither PHP or this sanitizing subject so I apologise in advance if this question might come across as ...
0
votes
0answers
29 views

how to include author in custom post type search

I have a search field where a user can type in something to search a custom post type. This works okay if the word exists in the title but not in the content. Also, I want to include authors in the ...
0
votes
1answer
710 views

change posts_orderby of the callback wp_query?

I found this answer that helps with ordering query results by the post type in my search query. But the issue is that it helps when I go to https://example.com/?s=query%20string that is if I search ...
0
votes
0answers
8 views

Showing Categories in Search Results (Wordpress)

I want to show the categories in the search results. How do I do this without plugins? Thanks My search.php <?php $s = get_search_query(); $args = array( 's' =>$s ); $...
42
votes
7answers
31k views

Extending the search context in the admin list post screen

I have created a custom post type and have attached some custom fields to it. Now I would like to the search that authors can perform on the custom post list screen (in the admin backend) to also be ...
0
votes
0answers
10 views

Custom search results page template

My custom search form searches for posts in two custom post types by selected taxonomy. Search results are displayed on blogposts page (index.php template) and I need to display results on custom page....
4
votes
1answer
1k views

Exclude custom taxonomy from search results and archive pages

UPDATE: I have the following code working. It excludes the taxonomy from the search results. However, I would like this only to happen if a user is not logged in. The code below is taking effect for ...
0
votes
1answer
16 views

Limit Search to Product Pages only unless I'm on Blogpage or Blogposts

I'm using the following code to limit my search to products only (searching in the product archive). // Only show products in the front-end search results add_filter('pre_get_posts','...

1
2 3 4 5
35