WP Custom Fields Search 0.3.4

This version doesn’t add much new functionality but does fix a bug whereby files could not be edited in the theme/plugin editors while the plugin was installed.  Thanks go to Florent for pointing that one out.

I strongly advise all users to upgrade as soon as possible.

This also includes the functionality to place searchforms in page and post content.  See the presets section (Settings > WP Custom Fields Search) for an example tag.  Thanks go to Ibrahim for the suggestion.

For instructions on using the plugin please see the 0.3 release notes

Category: Wordpress Plugins | Tags: , , , 78 comments »

78 Responses to “WP Custom Fields Search 0.3.4”

  1. baron

    Works great, thank you

  2. be advanced - WordPressで、カスタムフィールドを利用した高機能検索プラグイン

    [...] 「WP Custom Fields Search」 は、すべてのカスタムフィールド、カテゴリー、タグを対象とした検索機能を追加できるプラグインです。 [...]

  3. Redsoxmaniac

    This is a much needed plugin. There has to be more functionality on both the category, tags, and custom fields side and it seems like you are doing a great job. I will keep in touch on how it works on my site.

  4. Steve

    Hey, is it possible to add the fuction to search multiple custom fields with one search, not only one?

    btw: Great job!

  5. Don

    Hi Steve,

    Not at present, a few people have asked for this functionality though so I will be trying to get it into version 0.4. I’m a little busy with other projects at the minute though so can’t really promise when that would be.

    Thanks,
    Don

  6. Steve

    That would be awesome!!

    Im looking forward to v0.4 :)

  7. Enrico

    Graeat Plugin, it solves exactly what I need, but one: Is it possible to search between multiple sub-categories? I’d need to have multiple dropdown fields each with “parent” categories as titles and children categories inside.
    Thanks in advance.
    E.

  8. Jose Antonio

    Hi, am sorry for my English is not very good.

    I get the following error when attempting a search result that does not have:

    “There is no entry. Want to try another search?”
    if(function_exists(‘get_search_form’)) get_search_form();

    I would be very grateful if I can help solve the problem.

    Thank you very much and congratulations for the plugin.

    Greetings from Spain

    Jose Antonio

  9. Berardo

    Anyone tested the plugin with MySQL 4? Seems not working.. with MySQL 5 works great. Please let me know

  10. Jose Antonio

    Thanks for your reply. The version is 5.1

    Greetings

  11. Don

    Hi Jose,

    Sorry for taking so long to reply. As far as I can tell that code doesn’t seem to be coming from this plugin. I would guess you would need to check your theme for problems. The problem will probably be in a file called search.php in the theme directory.

    Thanks, Don

  12. Don

    Berardo,

    No I haven’t tested it for MySQL 4 compatibility yet, I will try to test this before the next release.

    Don

  13. Stephen

    Is there some way to make the category lister not check for posts there, I would like the dropdown to list every single category not just the ones it thinks have posts in it. I tried using the comma method to list that but that never returns anything from the category.

  14. Don

    Hi Stephen, the search uses the same method of matching posts to categories as is used to populate the drop down list. So if the drop down list is not showing any categories then nor will the search even if you force it to show the categories.

    I can’t really tell what the problem is without looking at your database, but I have this alternative version which worked for another project, could you give it a try and let me know if it helps? If it does I might merge it into the stable version.

    Thanks, Don

    http://www.don-benjamin.co.uk/files/wp-custom-fields-search-categories.zip

  15. Gab

    Cool plugin! :)

    I have added 2 comparisions: “At least” and “Up to” adding these lines:

    “UpToComparison” =>__( “Up To”,’wp-custom-fields-search’),
    “AtLeastComparison” =>__( “At Least”,’wp-custom-fields-search’),

    AND

    class UpToComparison extends Comparison{
    function addSQLWhere($field,$value){
    return “$field = ‘$value’”;
    }
    function describeSearch($value){
    return sprintf(__(‘ at least “%1$s”‘,’wp-custom-fields-search’),$value);
    }
    }

    The rusult is find in dashboard but the fields don’t show up in website.

    ALSO…

    Are u planning to have a cutomizable CSS? The way both dashboard and search form appear is pretty bad. I am using 2.7.1 MU and it really doesn’t look like in your screenshots.

    thanks!
    Gabriele

  16. Laura

    Hi Don,

    So this plugin searching only posts in the search results, not pages. Am I correct? If so, is there a way to get it to show pages too?

  17. FlyFro

    Hello.

    I’d like to use this great plugin on my new website.
    Everything works fine, but is there a way to exclude several categories or childcategories from custom search?
    Or force some to be not shown in the dropdown fields?

    Thank you very much – and thanks for the plugin!

    jan

  18. Isaac

    First of all this is an amazing plugin! Thanky ou, but I have a problem:

    When I use the widget and I put in my sidebar, this is not inside a border like all my other widgets, it is without border and I don’t know how to do it, after looking and looking, to make this plugin inside a border, to look like the rest of the blog. Any help will be welcome.

    Thank you!

  19. wolf

    Hi Don,

    can you parse out commas in search keywords?
    For example searching your site here, entering the search term “fields, search, public” doesn’t yield any result, whereas “fields search public” works perfectly fine. It would be great if your plugin parsed out all invalid search chars?!
    Thanks
    WOLF

  20. Don

    Gabrielle, glad to hear you’re pushing the boundaries with it. I’m not sure i can help without seeing the modified source code though. Do you need to add the fields to the search form through the admin interface?

    Laura, I do have the code for doing this I just need to build an admin interface for it. I will try to come up with a work-around soon if possible, but otherwise am planning on putting this functionality into version 0.4 of the plugin when (eventually) I find time to put this together. Sorry to keep you waiting.

    FlyFro, have a look at the instructions at the link below for setting the options in drop down lists. The interface isn’t the nicest at the moment but it should be possible to set-up the list as you want it.
    http://www.don-benjamin.co.uk/wordpress/projects/foss/wp-plugins/wp-custom-fields-search-03/#toc-setting-up-the-fields

    Isaac, it’s difficult to say what the problem is without a url to look at. If you have any suggestions for how I could change the html/css to fit in better with your theme these would be appreciated.

    Wolf, that does sound like a good idea, I’ll try and push that it into a minor release later in the week.

    Thanks,
    Don

  21. Matthew

    Hey Don,

    Thanks for the excellent plugin.
    Is there a way in parsing commas and money symbols?
    Take a look at my estate agent example:

    http://www.lifeofstrange.com/property/

    All the search fields work except the Price, putting just the number in the custom field without the pound and comma symbol seems to work.

    Any ideas?
    Thanks in advanced.

    Matthew

  22. Pierre

    Hi,
    First of all, thank you for your work.
    I have one question : how can I use the .pot file with my translation ?
    Is there an attribute to set somewhere ?
    Let me know.

    Thanx
    Pierre

  23. Ugur

    does not work with the new version of wordpress 2.8

    the place where “Data field” is, does not showing after selecting the “Data Type”.

  24. Ugur

    you are the best

  25. Pierre

    Hi again,

    Still haven’t found how can I use the .pot file, but I have another question :
    How can I use some rewriteRule to link to results page ?
    eg.
    instead of
    ?search-class=DB_CustomSearch_Widget-db_customsearch_widget&widget_number=preset-default&cs-City-0=Los+Angeles&search=Search
    something like that
    search/City/Los+Angeles

    I have write the rules, and the cs-City-0 value is well recognized (selected attribute is on the right value -the form is always in the sidebar) ), but I have a 404 page

    Any idea ?

    Thanx

  26. Don

    Piere: Not sure about the rewrite rules, are you trying to create a link to the search results? Or trying to rewrite the url that the form takes you to?

    With the pot file, I’m not entirely sure how they work, but thought that translation was probably a good idea so I created an english one. If you send it to me don@don-benjamin.co.uk I will have a fiddle and see if I can make it work.

    Thanks,
    Don

  27. Pierre

    Hi,

    Thanx for your answer Don.
    I’ll send you the pot file with french translation this evening.
    For the rewriteRule, that’s exactly what I’m trying to do : “create a link to the search results”

    Any idea ?

  28. Ivan

    Hi!
    Thanks for your job.
    Gab left here his code modification with “At least” and “Up to” variants. How it can be done? Or how to change “less then” on “up to” and more then on “at least”? For example more then 3 including 3 or less then 10 including 10.
    Sorry for my bad english.

  29. Jonah

    This thing rocks. ROCKS.

    I do need PAGE search functionality though. Any idea when we can get that?

    THX.

    BTW, if it is a matter of payment, I would be interested in paying you for your time.

  30. Marilyn Langfeld

    Thanks for this great plugin.

    I’m working on a food and wine site, with taxonomies for foods, wine, beer, spirits. I don’t see how to set up categories or even custom fields that would allow me to select a subset for a particular search.

    For instance, in the wine section, she would like a search with fields for: country, region, appellation, vintage, vintner, price. That would be fine, except that other sections will have different set of fields. If I set all the search terms as categories, the list is too long, with many extraneous terms per type of beverage or food. I’m not sure if using custom fields would work.

    The goal would be to have different search boxes on different pages, one for wines, one for foods, one for beer, one for spirits.

    Is this possible? What do you suggest?

  31. Mike

    Great plugin! Would be helpful to have an option for multiple check boxes rather than just radio buttons.

  32. Pete

    Does this plug-in work with WordPress 2.8? I am unable to get it to return any post results.

    Any help you can provide would be greatly appreciated. Thank you!

  33. JEM

    Thanks for this great plugin.

    And How To Hide [DB WordPress Plugins] WordS,

    Is it Be Hide?

  34. Don

    Pete,
    I think the plugin should work with wordpress 2.8, I’ve certainly got it working on a few sites although obviously it’s not as thoroughly tested on this setup as it is on the more mature releases. Could you try this version http://www.don-benjamin.co.uk/files/wp-custom-search-categories.zip and let me know if that helps?

    Thanks,
    Don

  35. Pete

    Don,
    Thanks for the reply. I downloaded, installed, and tested the plug-in from the link you provided and unfortunately, it did not work. I did however come across something interesting…

    If I only place one value in the drop down box, the search returns the proper posts. If I place more than one value (each separated by a comma), the search returns no results.

    I found that interesting and hope it may be something that can be resolved in the near future. Thanks for your help and I look forward to your next reply! :)

  36. Pete

    Don,
    Scratch that last reply. If there’s more than one value in the drop-down menu, it only returns posts for the first value. Any value after the first comma returns no search results.

    Thanks,
    Pete

  37. Boboc Ionut

    Hello Don,
    Congratulations on your plugin, i put this on a travel site http://www.abctours.ro and when i try to search custom fields for prices i get no result , can you tell me if i’m doing something wrong ?

    all i get is “Keyword not found, please try a new search.” if i select any from the combobox, i receive all the results as expected

    Thank you for your time

  38. Don

    Boboc: The release I put out yesterday had a bug in it which has broken custom fields search. Hopefully if you get today’s version you should be okay.

  39. fatih

    great work!

    we are waiting for ver4.

    thanks

  40. icecubejackal

    How to apply the search code in my wordpress template not in post or page or widget, i want to put in anyway in my template.

  41. Marco

    Hi,

    Thanks for the plugin. Works nicely.
    Just one question. I have 5 main categories and some of those categories have subcategories. How make a drop down for those 5 main categories but still have search results returned for the subcategories of that main category. For instance, Property for Sale is main category. Villa/House is sub category of Property for Sale. Now the drop down will show Property for sale and the search should return ALL results for property for sale, even if the post is in a subcategory Villa/House.

    Help is appreciated.

  42. Nick

    Hi Don,

    Great plugin!

    I have encountered a couple specific problems:

    I am using this plugin to search 2 custom fields. I have this set up on a specific page to display 2 drop-downs of specific custom field values. you can see this here: http://ncs.lodjixmedia.net/venues/

    The problem I’m having is that when displaying the search results (which works fine for the most part), my sidebar no longer works. Using the regular search has no adverse effects on my sidebar.

    My sidebar code is posted here on WP support: http://wordpress.org/support/topic/plugin-wp-custom-fields-search-custom-fields-search-results-issue?replies=3

    Also,

    The search results appear to be displayed on my Homepage template as opposed to my search template. Can you tell help me figure out how to set this up to use my search template (so i can use if (is_search()) to display a specific title)?

    Thanks for your help =)

  43. Mery Martinelli

    Hi Don,

    thanks for your plugin, I really appreciated it.

    I’m translating the website http://www.la-colombaia.it with qtranslate plugin and I’m trying to understand why the drop-down search field of your plugin always shows categories in one language only.

    Could you help me, please?

    Thanks a lot,

    Mery

  44. Simon

    Hello,

    If I click show/hide config the fields are not open to customize. I have installed into multinetwork wordpress(Version: 3.0.1) site. How to open?.

    Simon

  45. DHEA Side Effects :

    is there a good free french translation tool on the internet ?”**

  46. Cooker Hoods %0A

    most travel sites have very nice webpages and their services are very nice too. ‘,;

  47. Melissa

    Is there a way to create an option in the drop down that doesn’t select any category? I’m using this as a directory and want people to be able to search by department if they know it, but be able to leave that blank if they don’t know it.

  48. Ben

    Hi Don,

    Great plugin thanks.

    Having a few issues related to the plugin returning results using the home page / blog template (styling results page for example, and history tracking showing “home” page title)

    Would there be an easy way for the plugin to use the search.php template to display the results?

    Cheers
    Ben

  49. monarch

    hi,

    Great plugin.

    Just a quick question when the results are displayed they use the ‘medium/ setting and not the ‘thumbnail’ for image size. Any idea where i can change this?

    Many thanks

  50. Mandy

    hi there

    I Need to EXCLUDE some Categories from the search result… i have added the following code to the functions.php file but it doesnt seem to exclude the categories for the WP-custom-search:

    function SearchFilter($query) {
    if ($query->is_search) {
    $query->set(‘cat’,’1,17,6′);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,'SearchFilter’);

    There must be an easy way to do this.

    Love the plugin by the way… if anyone can help me figure this out it will be perfect!

    Many

  51. Mandy

    hi there

    I Need to EXCLUDE some Categories from the search result… i have added the following code to the functions.php file but it doesnt seem to exclude the categories for the WP-custom-search:

    function SearchFilter($query) {
    if ($query->is_search) {
    $query->set(‘cat’,’1,17,6′);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,'SearchFilter’);

    There must be an easy way to do this.

    Love the plugin by the way… if anyone can help me figure this out it will be perfect!

    Mandy

  52. James

    HI Great plugin, good work! Is it possible to combine all the options like categories and custom fields in to one drop down menu?

  53. frmars

    Hello
    I am testing your plugin which does a great job.
    Problem : when showing results, it shows FULL articles.

    I do need to show only titles or excerpts (more than necessary when results are above 20 or 30 articles)…

    Is there a way to do that ?

    I am amble to modify PHP a bit but I am not a programmer.

    Thansk

  54. satisfied plugin user

    hello don, could you please guide me how to change the result URL from the default to “clean URLs” for SEO purposes….

  55. Chris

    Hey great plugin.
    Where in the script do I need to be to give the select boxes a class?

    Thanks

  56. roycegracie

    no one have a solution for excluding cats in the dropdown ?

    I’ve been looking for an answer for this all over goolge and this forum and it seems that it was asked a lot with no answer:

    How to exclude cats from the dropdown?

    if anyone have any idea, please share…

    thank you

  57. sanguango

    Hi Benjamin. First of all, thank you for such a great plugin. I’m trying to use it in my website but I have two problems:

    1) I am trying to exclude a category from the front page, but I want those categories to appear in the search results. I installed some plugins to exclude categories from the front page and they work fine. The problem is that when I want to search for those excluded posts with your plugin, they don’t appear in the results. Do you know which is the problem?

    2) Is it possible to customize the plugin? I would like to change the colors of the plugin, but I cannot find where to do that.

    Thank you

    San

  58. mikey

    Hello Don and thanks!

    Question:

    Is a class automatically generated per form label+input cell?

    For example, I would like to add a different image next to form legends by using with appropriate css…

  59. mikey

    @roycegracie

    I think you have to use the Drop Down options box and type in all categories you want to be searched separated by a comma.

    If you want the option “any” as well you have to write it that way:
    :ANY,category1,category2,category3

  60. mikey

    @frmars

    You need to modify your php file associated with search results.

    By default it is often named search.php and you can create a loop-search.php file which will be used instead for treating the search and result loop. I has nothing to do with the plugin.

    ID, ‘Image’, true) ) : ?>

    <div id="post-” >
    <a href="” title=”" rel=”bookmark”>

  61. Claudio

    Also I have the problem between WP custom field search and QTRANSLATE plugin: the drop down menù displays categories only in the first language and the results are given in the same first language. I’m not be able to have the drop down items displayed according to the language selected and same for the results.

    May sameone halp me?
    Thank you very much!

  62. Claudio

    For those who know a little php I can bring a piece of code contained in the file “extra_search_fields.php” inside of WP Custom Search plugin that I modified in the first part (successfully) to get a display of multilingual writing that appears before the choices. So there:

    function getOptions($joiner,$name){
    if($this->param(‘fromDb’,!$this->options)){
    $options = array(”=>__(‘TutteAllAll‘,’wp-custom-fields-search’));
    $auto = $joiner->getAllOptions($name);
    asort($auto);
    $options +=$auto;
    return $options;
    } else {
    return $this->options;
    }
    }
    function getInput($name,$joiner,$fieldName=null){
    if(!$fieldName) $fieldName=$name;
    $v = $this->getValue($name);
    $id = $this->getHTMLName($name);

    $options = ”;
    foreach($this->getOptions($joiner,$fieldName) as $option=>$label){
    $checked = ($option==$v)?” selected=’true’”:”";
    $option = htmlspecialchars($option,ENT_QUOTES);
    $label = htmlspecialchars($label,ENT_QUOTES);
    $options.=”$label”;
    }
    $atts = ”;
    if($this->params['onChange']) $atts = ‘ onChange=”‘.htmlspecialchars($this->params['onChange']).’”‘;
    if($this->params['id']) $atts .= ‘ id=”‘.htmlspecialchars($this->params['id']).’”‘;
    if($this->params['css_class']) $atts .= ‘ class=”‘.htmlspecialchars($this->params['css_class']).’”‘;
    return “$options”;

    Thanks for the help!

  63. Alvaro

    Great plugin. Is there any way to sort search results by title? I have tried to insert ORDER BY post_title in some MySQL queries in extra_search_fields.php file but it doesn’t work. Thanks.

  64. Carl O'Dell

    Is there any way to sort by custom fields?

  65. Andy

    Hi don, and thanks for the plugin!!! :)
    have u a solution for a questions number 55 ??

    ” no one have a solution for excluding cats in the dropdown ?

    I’ve been looking for an answer for this all over goolge and this forum and it seems that it was asked a lot with no answer:

    How to exclude cats from the dropdown?

    if anyone have any idea, please share…

    thank you”

  66. roycegrace@walla.co.il

    hi Andy, i just used the option to include the cads i want it to show.

    you write the name of the cats spreted by comma….
    i wanted to exclud 2 but the solution is good as tell for me…

  67. erika

    The plugin works great, my only issue is the pagination. It will not work if I have the custom permalinks, only if the permalinks are default.

    With custom permalinks, it create a string as:www.site.com/page/2?…
    while with the default it will add &paged=2 at the end of the string. The first one, page/2/ does not work.

    Could you please help me? I need to keep the custom permalinks.

    thanks

  68. zero

    WordPress Custom Search Plugin it is good

  69. thegrunt

    hey, on many requests for hiding specific categories i would like to commit an possible answer for you : just read it here: http://microle-systems.com/wordpress3/missionjobsuche/?p=140

    PS just mark the text so you can read it i had till now no motivation to style my single php.

  70. tc

    This plugin is awesome, however there are no more update available. When I activate the plugin, it brings a lot of warning messages in the latest version of WP. Anyone here have tried customize this plugin in order to working in the latest version of WP (v3.4) ?

  71. Large Houses

    We use this plugin on our site to view large holiday houses. Thank you very much indeed!

  72. money online fast pp

    Howdy! Do you know if they make any plugins to assist with Search Engine Optimization?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Many thanks!

  73. Ranjita

    Hello

    I had used WP Custom Search 0.6 version in my wordpress site with classiclean theme. When i upgrade to wordpress version 3.5, the custom field doesn’t appear in one of my pages. Why this is happening and what to do? PLEASE MAIL ME AS SOON AS POSSIBLE. PLZ PLZ

  74. alicia silverstone

    I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to design my own blog and would like to know where u got this from. appreciate it

    My homepage – alicia silverstone

  75. Natarajan

    Hi ,

    Thanks for post and nice plugin. really it is good and more useful..

  76. Kerry

    I would like to install this on a client site. In the post above you strongly recommend upgrading to 0.3.4. However, the only version available on the WordPress plugins site is 0.3.23 and there is no option to upgrade that plugin once installed. Where is the most current version available?

  77. don

    Hi Kerry,

    Apologies I need to update my site. 0.3.23 is the latest version, this post is a little out of date. Software version numbers are usually notated differently to standard decimal point notation so 0.1 (zero point one) is not the same as 0.10 (zero point ten) so 0.3.23 is newer than 0.3.4 even though standard mathematical notation would suggest the other way round.

    The next release will be quite a large rewrite so should be 0.4.0 (or maybe even 1.0.0, I’ve not quite decided) which should make it a little more obvious.

    If you do want older versions though you can see the full history of releases here: http://wordpress.org/plugins/wp-custom-fields-search/developers/

    Thanks,
    Don

  78. gautam

    How to search, because m using this plugin but when i search it show error
    file not found. also their is no file(field) in database.
    how to run this file


Leave a Reply



*

Back to top