Skip to main content

Questions tagged [search]

The method by which users find information on your WordPress site

0 votes
0 answers
13 views

Multiple search forms and respective results page templates?

I have a Woocommerce site and I would like to set up two different search forms, one for products and one for everything else (pages, posts, and a couple CPTs) that would render on it's own respective ...
0 votes
2 answers
961 views

How to block specific keywords from searching on WordPress?

I'd like to block some specific banned keywords from searching on WordPress. Or I'd like to show a redirect when someone search specific keywords. How to do?
1 vote
1 answer
1k views

How do i search authors from search form using author's name

I am trying to use a search from authors, listings(i.e custom post type) products(i.e custom post type) I am able to search for custom post types but unable to do so for authors. I am using the ...
1 vote
1 answer
4k 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
1 answer
3k views

How to display image thumbnails on the search results page?

Been trying to get images to appear on our search page, but only time i can get the two pieces of code to work it removes all of our sites formatting and style. Am i missing something. :( NEW Code ...
0 votes
1 answer
2k views

Search bar for page that searches only particular page IDs

How can I create a search bar for a page that searches only in particular page IDs? This shouldn't affect the search bar on other pages. I tried the following: add_filter( 'pre_get_posts', '...
0 votes
1 answer
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
1 answer
6k 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' =&...
2 votes
1 answer
3k views

Search not working with title and content

I am working on search. I am able to search post by tag and category but not able to search by title and content. I tried below code but it's not working. Would you help me out? $getSearch = ...
1 vote
0 answers
17 views

How to make search by ID work on front-end?

we created a website where people can post lonely hearts ads. For now we only have a Dutch version available but the idea is to expand to other countries too. It's a great market, and fun to do. But I ...
0 votes
1 answer
2k 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('...
1 vote
1 answer
1k 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 ...
6 votes
2 answers
2k 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
2 answers
1k 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 ...
2 votes
1 answer
1k 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 ...

15 30 50 per page
1
2 3 4 5
123