Grabbing term's slug on Ad pages
This is probably a very stupid question but - I've got a script pulling the term's slug on the Category indexes (for ad serving purposes) working flawlessly. However, I'm running into issues pulling that same slug on the ad pages themselves. Could someone correct me here please and thank you?
The code I'm using on the Category indexes:
PHP Code:
$term = get_queried_object();
$listing_cat = $term->slug;
The term I've been attempting to use on the Ads:
PHP Code:
$term = get_the_terms( $post->ID, 'ad_cat');
$listing_cat = $term->slug;