Skip to content

Instantly share code, notes, and snippets.

@mintplugins
Last active February 27, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mintplugins/1ab5acab2ebe727d0df9 to your computer and use it in GitHub Desktop.
Save mintplugins/1ab5acab2ebe727d0df9 to your computer and use it in GitHub Desktop.
Using Custom Taxonomies for Isotope Controls in MP Stacks + PostGrid:
function my_custom_postgrid_isotope_taxonomies( $isotope_filter_groups ){
//This array can contain custom groups (for outside sources like instgram), AND/OR WordPress taxonomy slugs.
$isotope_filter_groups = array(
'taxonomy1_slug' => array(
'is_wordpress_taxonomy' => true,
'filter_group_name' => __( 'Name of Taxonomy1', 'mp_stacks_postgrid' ),
'meta_field_ids_representing_tax_term' => array(), //Leave this blank if it is a WordPress taxonomy (as opposed to a "fake" one like "twitter-user")
//Icon info
'default_icon_font_string' => 'fa-th-large', //A default icon-font class string to use if no unique icon is given
'default_icon_image_url' => plugins_url( '/assets/images/user-icon.png', dirname( dirname( __FILE__ ) ) ), //A default url to use if no unique icon is given
),
'taxonomy2_slug' => array(
'is_wordpress_taxonomy' => true,
'filter_group_name' => __( 'Name of Taxonomy2', 'mp_stacks_postgrid' ),
'meta_field_ids_representing_tax_term' => array(), //Leave this blank if it is a WordPress taxonomy (as opposed to a "fake" one like "twitter-user")
//Icon info
'default_icon_font_string' => 'fa-th-large', //A default icon-font class string to use if no unique icon is given
'default_icon_image_url' => plugins_url( '/assets/images/user-icon.png', dirname( dirname( __FILE__ ) ) ), //A default url to use if no unique icon is given
),
'category' => array(
'is_wordpress_taxonomy' => true,
'filter_group_name' => __( 'Categories', 'mp_stacks_postgrid' ),
'meta_field_ids_representing_tax_term' => array(), //Leave this blank if it is a WordPress taxonomy (as opposed to a "fake" one like "twitter-user")
//Icon info
'default_icon_font_string' => 'fa-th-large', //A default icon-font class string to use if no unique icon is given
'default_icon_image_url' => plugins_url( '/assets/images/user-icon.png', dirname( dirname( __FILE__ ) ) ), //A default url to use if no unique icon is given
),
'post_tag' => array(
'is_wordpress_taxonomy' => true,
'filter_group_name' => __( 'Post Tags', 'mp_stacks_postgrid' ),
'meta_field_ids_representing_tax_term' => array(), //Leave this blank if it is a WordPress taxonomy (as opposed to a "fake" one like "twitter-user")
//Icon info
'default_icon_font_string' => 'fa-th-large', //A default icon-font class string to use if no unique icon is given
'default_icon_image_url' => plugins_url( '/assets/images/user-icon.png', dirname( dirname( __FILE__ ) ) ), //A default url to use if no unique icon is given
),
);
return $isotope_filter_groups;
}
add_filter( 'mp_stacks_postgrid_isotope_filter_groups', 'my_custom_postgrid_isotope_taxonomies' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment