I changed my taxonomy slug from singular to plural ("state" to states").
Ever since then my taxonomy has been broken. It used to say OTHER instead of the state name. Now my urls look like this Domain.com/location/%states%/post-name
Im using wp-types.com and their support has been EXTREMELY horrible. I barely even get a short useless response once every 4 days.
They provided me with this code for my themes function file (i placed it at the end):
add_filter('post_type_link', 'my_permalink_structure', 10, 4);
function my_permalink_structure($post_link, $post, $leavename, $sample) {
if ( false !== strpos( $post_link, '%states%' ) ) {
$term = get_the_terms( $post->ID, 'states' );
$post_link = str_replace( '%states%', array_pop($term)->slug, $post_link );
}
return $post_link;
}
And it gives me this error:
Parse error: syntax error, unexpected T_FUNCTION, expecting T_STRING or T_VARIABLE or '$' in /home/content/33/8824133/html/wp-content/themes/education/functions.php on line 131