List all categories but exclude current post category on single post page
The idea here would be to use the queried object’s ID to get the post terms (because we are most probably outside the loop here, if inside the loop, just use get_the_ID()). From there, we can use wp_list_pluck() to get all the term ID’s and simply pass that to get_terms() exclude parameter Just a note, … Read more