New answers tagged

0 votes

changing behaviour of get_search_form

However if somebody is looking for methode with old good tags of HTML, here is an answer i tested and it is working: Create file named: searchform.php inside Your theme directory. Copy and paste ...
J L's user avatar
  • 1
0 votes

How to Display Content from Search URLs on Permanent URLs in WordPress?

If you have registered a custom post type and have added a custom template for it to your theme, then you could do something like this. Add a helper function to functions.php that creates a custom ...
Antti Koskinen's user avatar
0 votes

changing behaviour of get_search_form

IMHO it should be use "add_filter" as Liton Arefin wrote, which should be added inside functions.php of own created theme of Wordpress. It should override all variables need to override ...
J L's user avatar
  • 1
1 vote

Search with indexing and linking to PDF content

By default, you won't be able to search the pdf file unless you use some software or script to take the data out of the pdf and put it in some place that it can be indexed and searched (or use a tool ...
Adam's user avatar
  • 71
0 votes

Exclude in search post and include only 3 pages

you're using $query->set('post_type', 'post'); to only include posts. What you can do is make it an array to include the post type and those specific page IDs you want. Here's an example code: ...
ray-happyforms's user avatar
0 votes

Exclude multiple custom post types from search

This is because elseif doesn't work the way you think it does. You're trying to use it in a way that's closer to a switch statement or multiple if statement` This: if (post_type_exists('videos')) {...
Tom J Nowell's user avatar
  • 57.6k
0 votes

Exclude multiple custom post types from search

// Exclude custom post types from search add_action('init', 'cdxn_remove_custom_types_from_search', 99); function cdxn_remove_custom_types_from_search() { global $wp_post_types; if (...
NeaMitika's user avatar
0 votes

Custom Loop Query For Search Page

How can this be done with including an orderby for first relevance and second post date desc? Would it be inserting two orderbys above the 'order' line? Any insight into this would be greatly ...
Luke Stephens's user avatar

Top 50 recent answers are included