Questions tagged [search]

The method by which users find information on your WordPress site

Filter by
Sorted by
Tagged with
1
vote
1answer
2k views

Seach custom post type posts only by meta fields?

is it possibile to search custom post type product by _sku or other custom meta field with input text field? I don't want to use plugin, just need custom WP function. I have found this solution for ...
0
votes
1answer
15 views

WP_List_Table Inside Metabox Not Working on Clicking Search Button

I'm trying to display a WP_List_table inside a metabox. The metabox is for listing registered users to a course(LifterLMS Course Post Type). The table columns contain user_id, user_name, percentage &...
1
vote
2answers
687 views

Show matching categories in search page

my current search only shows POSTS as results. http://newslines.org/?s=george My site has categories for George Clooney, George R.R. Martin etc. How do I get a list of categories that match the ...
0
votes
0answers
10 views

search fulltext

I am modifying the search code of an old version of wordpress. Searching with% like% does not work if there are several words that are searched, I want to try fulltext. This is the code I am modifying....
0
votes
2answers
663 views

Conditional posts in WP_query for search

I have a custom post type that im trying to limit results in search. The CPT is a deal/coupon, with a start and end date for each of the deals. What I'm trying to do is only show these posts in ...
0
votes
1answer
16 views

Hide Search Form above results

I have a search form in the navbar. This works just fine, but when results are displayed, the search form is repeated above the results. I would like to keep the search form in the navbar, but lose ...
0
votes
0answers
20 views

Content disappears when searching with Search & Filter plugin

I manage a website in which the plugin Search & Filter is being used to go through the content by visitors. With a particular search query, the content appears correctly, soon to disappear ...
0
votes
1answer
1k views

Advanced search form with multiple custom fields

I'm working in a site that allows to search for lawsuits about medical malpractice, the client wants to have a search form almost equal to the one in this site: http://psychcrime.org/database/ All ...
0
votes
1answer
9 views

Including taxonomy in searches

(Fairly new to WordPress, but I'm a React / NodeJS developer) I have a basic search function that search a custom post_type (listings). It makes use of the standard built in get_search_query and ...
0
votes
0answers
16 views

image only display in custom search

Please help me find a solution on displaying ONLY images in the search results. I’ve searched around and found nothing of such sort. I’m trying to develop an image content website similar to stock ...
0
votes
1answer
650 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
590 views

Creating a custom search for a specific post type

Ok, so we know Wordpress comes with a built in search form. However, I've created a custom archive page that lists posts from a specific post type. I would like to integrate a search box that only ...
0
votes
1answer
661 views

Exclude image url from search query

I have a question today. I have recently completed a website and there is search box integrated. And, I have a post which has an attachment(attachment's url is www.sample.com/image/sampleimage.jpg) ...
1
vote
1answer
31 views

Setting custom search engine indexing for a “dynamic WordPress page” with htaccess

I am searching for hours but didnt found the code for my requirement, Can my requirement be done with htaccess? Requirement - These urls of a page should be indexed by Google: example.com/example-...
0
votes
1answer
1k views

WP Query - Search in title or author_name

My need is to have a WPQuery that searches for posts which title is 'test' OR author_name is 'test'. Here is the code I tried: $search_query = get_search_query(); $args = array( 'relation' =>...
0
votes
1answer
643 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 ...
0
votes
1answer
30 views

Woocommerce: Search by custom attribute

I have created an attribute for products which is named: code. But default wordpress search functionality doesn't search code in front end. How I can modify it in order to include code in search ?
0
votes
1answer
629 views

How Can I Make Dynamic Search Form While Converting Html To Wordpress?

I Am Converting Html to Wordpress. I Can Make Simple Searchform through <?php get_search_form( $echo ); ?> But I want to show Nothing Found if it can't find any data through search. How Can i ...
1
vote
1answer
676 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
13 views

Search in multiple categories using $query->set

Right now i have this code: function exclude_categorii( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( $query->is_tax ) { $query->set( 'category__in', ...
3
votes
2answers
2k views

Custom slug in front of search URL

I'll try explain this the best I can... I have a search form on my homepage: <form role="search" method="get" id="searchform" class="form" action="<?php echo esc_url( home_url( '/' ) ); ?>"&...
1
vote
2answers
163 views

How to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
0
votes
0answers
14 views

custom search refreshing on submit and not giving results

The custom search refreshes on submit and also does not give any results. I am not sure what is wrong with the code but if someone could take a look at it to help me see what I am missing, I would ...
1
vote
1answer
706 views

Search pages that are a child of the current page

I'm developing my own Wordpress theme and I was wondering if it is possible to modify the search query in a way that it only return results that are child pages of the actual page. The reason I want ...
0
votes
1answer
17 views

Replacing word in wordpress Search not working Properly

I want to replace word/character in wordpress search using the below code, though it works but not well. E.G: if i search for only var it replaces var to foo and its works properly fine. but if i ...
1
vote
1answer
42 views

Advanced search by two criteria - sort by location and date (ascending or descending)

I have spent a couple of days working on this and I am still not able to figure it out. I am trying to make advanced search filter that sorts posts from a specific category on two criteria: location (...
1
vote
1answer
792 views

Search results ordered by custom post types are not grouped

For a WordPress website I have a couple of custom post types, named cities and books, and also the regular blog posts. I have customized the search results (only search in the post title) page so that ...
-1
votes
0answers
11 views

Search Permalink seprerator from from + to -

I have searched all over google but nothing seems to work, Is there any way to make wp search permalink structure from + or space to - I.E https://wordpress.stackexchange.com/search/ask+your+...
0
votes
0answers
11 views

How change post_from with query filter?

Hi i m tring to ovveride a plugin query to database. I m succeded to change post_where in this way. remove_filter( 'posts_where', 'gmw_ps_pt_query_keywords', 20 ); add_filter( 'posts_where', '...
5
votes
1answer
3k views

WP Query where title begins with a specific letter

I want to search for posts with WP_Query() and select only posts that begin with a specific letter. I found a bunch of old posts with filters that were pre-4.4, but since 4.4 there is a title search ...
0
votes
2answers
16 views

How do I properly redirect outbound links with special characters

The search form on my website has a couple radio inputs for the user to select which source (all but one are external to the website) the search query should use. I retrieve those inputs (search ...
0
votes
1answer
37 views

Display the search results like the original pages

I'm creating my site (locally) and I'm using the starter theme underscores.me I created few pages using bold, italic, and other text styles, but I noticed that in the Search Results page, the content ...
0
votes
1answer
738 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 ...
0
votes
0answers
42 views

Replacing + sign to - in wp Search Permalink

I have really tried my best but nothing is working out, I want to replace my wp search permalink [spaces] and + to - Example: https://wordpress.stackexchange.com/search/i love you to https://...
1
vote
0answers
25 views

Change WordPress search Permalink structure

Please I want to change my WordPress search permalink structure, from + as the separator to - Example: https://wordpress.stackexchange.com/search/please+help+me+out To https://wordpress....
0
votes
2answers
1k 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
votes
2answers
903 views

Save search criteria per user and show on custom user page

I have a property website with a custom search form for minimum and maximum square feet. A registered user executes a search with a min(i.e. 150 sqft) and max(i.e. 300 sqft) select option value. I ...
2
votes
1answer
794 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
0answers
17 views

URL search link for 'category__and' instead of php query

I found this in the WP Docs: Display posts that are in multiple categories. This shows posts that are in both categories 2 and 6: $query = new WP_Query( array( 'category__and' => array( 2, 6 ) ) ); ...
-1
votes
3answers
2k views

I need a custom search page to lead to search.php but it goes to index.php

I built a custom search page with a form like: <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> trouble is I want the results to appear in search....
0
votes
2answers
1k 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, [...
0
votes
0answers
15 views

Modify main search form to search user too

I'm not sure if it's possible, i would like to modify the main search to allow search by user profile too... I only found solution for separate search.
5
votes
5answers
11k views

Including categories in search results

I am trying to include categories in search results. I've been searching for hours now with no solution. By "including categories" I don't mean search in a certain category, I mean let's say I have a ...
0
votes
1answer
2k 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 ...
0
votes
0answers
50 views

Post Type Search Gives Unexpected Results

I am working on a WordPress site that has several custom post types. Of course this lends itself to writing a custom search form. However, the results from test searches have been less than ...
0
votes
1answer
11 views

Allow WP users to sort search result on a videos site

So I have a video site based on wordpress - The search page currently shows post in date order but I want the users to have an option to sort the results by different options for example sort by views,...
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
2answers
43 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'...
0
votes
2answers
1k 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
1answer
2k views

Basic wordpress search shows no results

I have one of those "wtf" problems again. I can't figure why my search form shows no result. See this webpage: http://sindlar.cz/exemplum/?lang=en There is get_search_form() in the header. I also ...