Snippets: Add new classes for the theme’s custom select styles

By default the theme doesn't add the custom select dropdowns to all selects on the site because it can conflict with 3rd party plugins (such as ajax functions). That said, you can easily use a theme filter to add new classes/elements to the theme that you want to apply the custom select styles to. See the example snippet below. You can view functions.php and search for 'customSelects' if you want to see the default items to which the custom select is applied to.

add_filter( 'wpex_localize_array', function( $array ) {
	$customSelects = $array['customSelects'];
	$array['customSelects'] = $customSelects .' your-custom-class';
	return $array;
} );

Snippet Type: PHP

Posted Under: Other

All PHP snippets should be added via a child theme's functions.php file.