All Questions

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

Site search gets me to posts page

I've built a web shop, on my 404 page I've a search bar, if you search there for a products it redirects me to a page with all the posts, but i want it to redirect me to the product search page, or ...
0
votes
1answer
43 views

Remove pagination if search returns empty

I made a fix that when the searchbar is empty, it returns 'No results', instead of all posts, but the pagination still shows up. Does anyone know a fix for that? My code search.php: <div class="...
0
votes
0answers
78 views

How do I search WordPress posts by categories and tags in addition to title and content?

I would like to expand my site's default search fields (title and content) to include categories and tags without installing a plugin. Including the below code in functions.php allows me to ...
0
votes
1answer
205 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( "#...
0
votes
1answer
395 views

How to get value of a selected option from select tag and use it in WP_query to filter posts?

This is how I'm getting the value but how to use it in WP_Query so when I click Search to display let's say posts with Option 1 value? I'm doing this but don't know if meta_value is the answer $...
2
votes
0answers
392 views

Search query - exact post title match

I have a bunch of posts titled something like this... English Language 2015 English Language 2016 English Language 2017 English Language 2018 And on each one of these posts I have a dropdown select ...
0
votes
2answers
2k views

wp_query 's' parameter does not work with custom post type

I have a custom post type 'property'. I am trying to make a search for it, but it does not work with wp_query parameter 's'. $wp_query = Wp_Query(['post_type' => 'property', 's' => 'test']); ...
0
votes
1answer
61 views

show only one category and filter by tag

I have a page that I would like to show one posts from just one specific category. I'd then like a function to search the posts within this one category on just this page. I don't mind how it's ...
0
votes
1answer
81 views

On Wordpress Search, how to search post from Author meta also

With below code working for searching with post title and post content. And also after installing plugin 'ACF: Better Search', the post is also searching from the ACF fields and give search result on ...
0
votes
1answer
2k 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
111 views

How to hide meta from search result only on pages?

I have different content on static pages and post in my WP site. On pages is not desirable to view meta in search result, but in my post is important. Meta, I mean information about author, and date ...
0
votes
1answer
23 views

Search doesn't display posts with images

I’m new and need help with something. I am making a website for a business that wants to display all their instruments (photos with their measurements) as shown below. https://ibb.co/gSf3eF Then ...
1
vote
0answers
449 views

Add post location with mile radius allowing search

I have a custom post type (CPT) called directory. Within this CPT there are taxonomies such as builder, plumber, painter etc. I would like to be able to add a location and a distance radius where the ...
1
vote
0answers
122 views

Search results posts_orderby and ID

I'm using this function for customizing search results: function order_search_by_posttype( $orderby ) { if( ! is_admin() && is_search() ) : global $wpdb; $orderby = "CASE WHEN ...
1
vote
3answers
1k views

Pagination not working on custom query

I am trying to change pages when I search by category on my website. When I am not searching under a certain category I can switch pages fine but when I am searching for a category I am unable to ...
0
votes
1answer
67 views

Find post tags words in post content and link them to tag URLs

I would like to create link of word(s) in post content (word(s) which is used as post tag of current post) to post tag URL. I created this, and it works, but only for one word (last tag) of post. $...
2
votes
1answer
1k views

How to search only by post title and category?

I'm currently working on my first theme (based on underscores) and just realized the search does not return any results if I input a category name, nor does it give accurate results when searching ...
0
votes
1answer
43 views

Custom author search

I would like to do custom search pages that allow users to see posts written by one and only one specific author. For example, let Bob and Bill be the authors on a blog. One page would allow me to ...
0
votes
1answer
94 views

Include post_date in search

I'd like to search posts by year. For example, I could type in "June 2015" and all posts from that time appear. Or, I could type "2015" and all posts from the year appear. Currently, I have ...
1
vote
2answers
2k views

Search for posts based on their url in the admin?

In the "posts -> all posts" admin page, I would like to search and see only posts with some element in their url (for example, the character "-3" to indicate they are a duplicate post). How can this ...
1
vote
1answer
25 views

How to change wordpress dates to native language (even if the languge not available i wordpress)

I have a fully native language website ( Sinhala ). Content is fine and works with sinhala text. But unfortunately I cannot get the dates to be shown in Sinhala ( in posts new etc). Also I need to get ...
1
vote
0answers
845 views

Posts and Attachments with “Published” status in Search

I would like the search to show only published posts and attachments (the attachments are photographs taken directly from the media library). The trouble is, when I specify that the post_status must ...
0
votes
1answer
170 views

WordPress search for specific Post Type

I am doing a WordPress site and use a custom post type 'studentinfo'. I want to build a search form and search template that will retrieve only search result from the specific post type studentinfo. ...
-2
votes
3answers
1k views

How to get only post='product'

I am using this code to search products from a wordpress/woocommerce website. My requirment is URL will be like "http://localhost/wp/?s=D34&post_type=product" While s=D34 is search string. When ...
0
votes
1answer
615 views

Display result of custom form

The website I am working on can list restaurants and we can rate them. Currently, I'm developing a multi criteria search to find the good one. I created a custom HTML form with XYZ Html (plugin) and ...
1
vote
2answers
1k views

How do I change the core post search algorithm? Where is it found/constructed?

I have wordpress and woocommerce installed and I noticed that woocommerce's product search seems to use wordpress's search. Well, I don't like the search, and I'd rather alter it at the core rather ...
1
vote
1answer
294 views

Count search results in heading

On my wordpress search page I would like to show a 'total found results'. This needs to be shown at the top of the page in a heading. I've tried this code but I gives me only the results of the ...
0
votes
1answer
847 views

How to add add more properties to WP_Post object in search results loop

I am using a plugin called Event Organiser, and it seems that it will only append its custom properties to the post object for all other instances of the WordPress loop except the search. Is there a ...
0
votes
0answers
219 views

Customize search results to include custom posts and display in a specific template page

Below I have a function working that includes my custom posts in search results. I would like to now display these results in a specific template. I tried adding the two commented out lines but it's ...
0
votes
1answer
40 views

WordPress Search

I'm trying to write a search feature on a website of mine, and it seems like it's not pulling in any of the pages, only posts. Below is the code. Search Form: <form role="search" method=...
0
votes
1answer
678 views

Search page for custom post type

I am new to wordpress and a beginner coder, and i was searching around the net, found solutions but still does not work. I have custom post type named dlm_download, and my custom search template not ...
0
votes
1answer
3k views

Private Posts/Pages & Search

I have a site up where there is one private page and one private post. When logged is as admin, i can view both of these, and they even appear in the search. However, when logged in as an editor, I ...
0
votes
1answer
779 views

Why does Wordpress search returns same number of results for every search query?

I am hitting a brick wall, I am searching something on a site I am building and on every search it returns 10 results when I know in the index in relevanssi it shows more for the term I am searching ...
0
votes
1answer
34 views

Hide parts of the post content after typing it's name or searching it by category

Code "nohome" worked for displaying wanted (hided'n'waiting) content on home page (just postname and image) How it could be adjusted or modified to make the same after name of post has been typed ...
0
votes
1answer
74 views

search content of pages and list in wp-admin

I am developing a plugin, and I want to display a page that lists every page on the site that is using a specific shortcode defined by my plugin. I assume that I need to manually search wp_posts, but ...
0
votes
1answer
139 views

How to exclude the word “class” from being matched in search?

I would like to exclude the word "class" from being matched to the search term "lass". On a site I'm helping manage, the search term "lass" is quite prominent. Unfortunately, that matches the common ...
0
votes
0answers
64 views

How can i retrive the movies, trailers, news in a single page using search

How can i retrive that. For a few month i build a website, and i want to make it diferent For the search i have 3 post type, and i have for each diferent themes for display - Movies - Trailers - ...
3
votes
1answer
2k views

Search posts by post author name

I want to search posts publish by particular author. For this purpose I added a filter in functions.php: function wpse_29570_where_filter($where){ global $wpdb; if( is_search() ) { ...
1
vote
1answer
699 views

how to hide specific post from google search

I have a wordpress blog set up on my site, example "blog.domain1.com". I have several categories and write posts under each category. I have one specific category that I don't want google search to ...
0
votes
1answer
520 views

Building a Data Intensive Website with Wordpress

I am an intemediate website builder and have been working with wordpress for a few years. I am attempting to build a website (for myself) that is data intensive. All I've built to date are sites ...
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 ...
3
votes
1answer
171 views

Search widget breaks when using multiple loops?

I have created wordpress template that uses two loops via WP_Query object. Everything works fine except Search widget. I've been pulling my hairs out for three days now Googling like a madman,but didn'...
0
votes
1answer
736 views

Custom Post Title as search term

is there any way to include custom post title as search term. I create custom post types - VHS, DVD, Blu Ray. Then in search box when I write DVD I want to list all posts from custom post type DVD. ...
2
votes
1answer
989 views

pagination hook doesn't work with search results

I use my custom Pagination function on my web site; #Pagination function pagination($prev = '«', $next = '»') { global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'...
1
vote
1answer
80 views

Display number of posts via adress bar?

when i call this link ; ?s=key&order=ASC wp display my search query order by ASC. ?s=key&order=ASC&number=10 how can we display whatever i want to display postnumber like 10 or more ? ...
0
votes
1answer
975 views

Total number of posts in query (category/tag/author/search results/main page…)

I want to know the total number of posts from the category/tag/author/search result that I am actually seeing. Say for example I am in the main page. If my posts_per_page are 10 and my pagination ...
2
votes
1answer
2k views

How can I get all posts data from within a paginated search result?

Let's say I'm doing a search on my site, and get 50 posts as a result. The pagination is set to 10 posts per page, so I have 5 pages of results. When I'm on the first page of results, if I inspect ...
0
votes
1answer
437 views

Related posts by searching post tags of single post as terms

I want to have a related loop of posts on single post pages and to do this I want to search the tags of the post. My first question is can you use the search in query posts for multiple terms and what ...
2
votes
2answers
3k views

How to get posts by content?

I found the following codes to get post details. However, it is not possible to get the posts by content. Does any one has any ideas? get_posts() //// get post //// $args = array( 'numberposts' ...
2
votes
3answers
15k views

Display all search results

Is there a way to display all the search results on the search.php? Actually it is displaying only 10 results (as set in WordPress settings > general).