Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?

This worked fine for me, except the whole system above has some issue with my configuration (I made my wp installation Multisite) that broke all the other posts. They are all not-found, although the permalink is retrieved correctly every time, as it was found.

I’m opening a new question for that other issue here so you can also use the code above safely.

  function term_link_filter_function( $termlink, $term, $taxonomy ) {
    if ( strpos('listing_type', $termlink) === 'FALSE' ) {
      return $termlink;
    } else  return str_replace('/listing_type', '', $termlink);
  }

add_filter('term_link', 'term_link_filter_function', 1, 3);

Leave a Comment