Title: Search column
Last modified: August 20, 2016

---

# Search column

 *  Resolved [Harmenvantwillert](https://wordpress.org/support/users/harmenvantwillert/)
 * (@harmenvantwillert)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/)
 * Hi, I would like to edit a little in the search function.
 * Now when I try to find a last name I have to select Last name from the dropdown
   menu which is Show All as default. When I search for last name I get the error“
   Please select a column.
 * I would like to have Last name as default selection instead of show all.
 * Some info:
    I have 4 columns; First Name, Last Name, Phone and Location. Everything
   works fine, for privacy reasons I can’t give the url.
 * [http://wordpress.org/extend/plugins/participants-database/](http://wordpress.org/extend/plugins/participants-database/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400589)
 * To preset the default search field, you need to use a custom template for your[
   pdb_list] shortcode. In that template, put something like this before the line
   that has `$this->show_search_sort_form();`
 * `$this->filter['search_field'] = 'last_name';`
 * That will set the search field selector to that field.
 *  Thread Starter [Harmenvantwillert](https://wordpress.org/support/users/harmenvantwillert/)
 * (@harmenvantwillert)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400636)
 * I don’t have a custom template, so this didn’t work for me.
 *  Thread Starter [Harmenvantwillert](https://wordpress.org/support/users/harmenvantwillert/)
 * (@harmenvantwillert)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400643)
 * Can’t this be done with the standard template? I have the following shortcode:
   [
   pdb_list fields=”first_name, last_name, phone, locatie” search=”true”]
 * I use the pdb/classes/PDb_List.class.php look for the line you suggested but 
   can only find:
 *     ```
       /**
          * prints the whole search/sort form as a shortcut function
          *
          */
         public function show_search_sort_form() {
   
           $output = array();
       ```
   
 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400653)
 * Read the section titled “Form Templates” on this page: [http://wordpress.org/extend/plugins/participants-database/other_notes/](http://wordpress.org/extend/plugins/participants-database/other_notes/)
 * It explains how to use a custom template on your site.
 *  Thread Starter [Harmenvantwillert](https://wordpress.org/support/users/harmenvantwillert/)
 * (@harmenvantwillert)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400659)
 * Don’t need to setup a custom template, I found the line in: templates/pdb-list-
   default.php
 * Added the line and now it works, thanx for point out the direction.
 * It now looks like:
 *     ```
       /*
          * SEARCH/SORT FORM
          *
          * the search/sort form is only presented when enabled in the shortcode.
          *
          */
         $this->filter['search_field'] = 'last_name';
         $this->show_search_sort_form()
       ```
   
 *  [bw3em](https://wordpress.org/support/users/bw3em/)
 * (@bw3em)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400660)
 * If you don’t use a custom template, you may lose any edits to the default template
   on updates to the plugin!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Search column’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [bw3em](https://wordpress.org/support/users/bw3em/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/search-column/#post-3400660)
 * Status: resolved