Created
March 7, 2016 15:26
-
-
Save kylephillips/616d0c8bf1c8bff91534 to your computer and use it in GitHub Desktop.
Include category filters in location search forms.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To Enable Category filtering for the location post type | |
* 1) Register categories for the post type | |
* 2) Include "category" in the "taxonomies" shortcode option | |
*/ | |
function add_categories_to_locations() | |
{ | |
register_taxonomy_for_object_type( 'category', 'property' ); | |
} | |
add_action( 'init', 'add_categories_to_locations' ); | |
[wp_simple_locator taxonomies="category"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment