Skip to content

Instantly share code, notes, and snippets.

@JoeHana
Created April 5, 2017 02:21
Show Gist options
  • Save JoeHana/6a856b564b3b0855ec85ac995c84eb80 to your computer and use it in GitHub Desktop.
Save JoeHana/6a856b564b3b0855ec85ac995c84eb80 to your computer and use it in GitHub Desktop.
Show advanced search fields by default
<?php
/**
* Show advanced search fields by default
*/
add_filter( 'wpsight_get_advanced_search_fields', 'custom_get_advanced_search_fields', 11 );
function custom_get_advanced_search_fields( $fields ) {
$fields_advanced['min']['advanced'] = false;
$fields_advanced['max']['advanced'] = false;
$fields_advanced['orderby']['advanced'] = false;
$fields_advanced['order']['advanced'] = false;
$fields_advanced['feature']['advanced'] = false;
return $fields;
}
/* Hide Advanced Search Button */
.listings-search-advanced-toggle {
display: none
}
@cantoute
Copy link

cantoute commented Nov 8, 2017

Hi,
May I suggest a couple corrections.
replace $fields_advanced with $fields
and for the css to work it has to be more 'specific' to override de default style

/* Hide Advanced Search Button */
.wpsight-listings-search .listings-search-advanced-toggle {
  display: none
}

@GiorgioMartini
Copy link

Thanks @cantoute if it was for the wp guys we would never get this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment