Get taxonomy name

I'm trying to modify a theme that has custom posts with custom taxonomies. At the bottom of the posts it displays a list of other posts (as in "you might also like...") What I'm trying to do is to filter the posts that are displayed in that area so they match the category of the current post. It's a tour company, I want to display tours on the same area.

The custom posts have a term/taxonomy (I still don't get this) called "st_tour_type" how can I get the name or value of the current post so then I can filter the ones display in the bottom of the page using that one as a reference?

At the moment I'm able to filter them manually if input the slug/name for "st_tour_type" but this doesn't make sense

$args = [                    
   'posts_per_page' => 4,
   'post_type' => 'st_tours',
   'st_tour_type' => 'lerwanda',

I hope you get what I need, it's my first time working with taxonomies...

Read more here:

Content Attribution

This content was originally published by David Esteban at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: