Skip to content

Instantly share code, notes, and snippets.

@richtabor
Created April 29, 2014 17:18
Show Gist options
  • Save richtabor/11406583 to your computer and use it in GitHub Desktop.
Save richtabor/11406583 to your computer and use it in GitHub Desktop.
Fix for adding "-" in lieu of spaces for categories with multiple words
<li class="isotope-item filter <?php if ( $terms && !is_wp_error( $terms ) ) { foreach ( $terms as $term ) { $cat = strtolower($term->name);$id = preg_replace('/[^a-zA-Z]+/', '-', $cat);echo $id; echo ' ';} } ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment