I’m having issues with hyphens in my slugs from a tutorial I’m trying to go through… http://wp.tutsplus.com/tutorials/theme-development/create-a-quicksand-portfolio-with-wordpress/ and I’m having a problem when my client uses hyphens in the category. The category is blank when the client puts in a hyphen for some reason. Otherwise everything else is working perfectly!
Has anyone else ran into this problem? I’m thinking its a js problem but am uncertain as I am not receiving any console errors at all. So I’m not for sure how to debug.
why not use
term_id
with any desired prefix:$term->term_id
. In this case You will have unique identifier and less possibility to breake something.final version could be:
$term_list .= '<li><a href="javascript:;" class="sort_by_term_'. $term->term_id .'">' . $term->name . '</a></li>';
will produce something like this:
<li><a href="javascript:;" class="sort_by_term_1234568">some long name with more words</a></li>
Info: http://codex.wordpress.org/Function_Reference/get_term_by