term_link() filter or rewrite and howto?

I know I am not answering exactly your question but in my opinion it is best to do it manually without messing with rewrite rules and filters. That way you keep also the default URL structure for terms templates, other plugins etc.

$terms = get_the_terms( $post->ID, 'industry');

if($terms && !is_wp_error($terms)){

    echo '<ul>';

    foreach ( $terms as $term ) {

        $url =  home_url() . '?fwp_industries_dropdown=' . $term->slug;

        echo '<li>';
            echo '<a href="' . $url . '">' . $term->name . '</a>';
        echo '</li>';

    }

    echo '</ul>';
}

Leave a Comment