Tag: the_category

  • List taxonomies and categories without link in WordPress

    List taxonomies and categories without link in WordPress

    Maybe you wanna list taxonomies and categories by function the_terms(‘,’) or the_category(‘,’) but without the Links, these filter below can help make it. add_filter(‘the_terms’, ‘no_terms_links’, 10, 2); function no_terms_links($term_list, $taxonomy) { if (‘publication_category’ === $taxonomy){ return wp_filter_nohtml_kses($term_list); } return $term_list; } //the_category add_filter(‘the_category’, ‘no_category_links’, 10, 1); function no_category_links($thelist) { return wp_filter_nohtml_kses($thelist); }