Quantcast
Channel: Altschuler
Viewing all articles
Browse latest Browse all 60

How to Get a Taxonomy Term Name From its Slug in WordPress

$
0
0

In order to get the name of a taxonomy term from its slug, use the following code, where “fish” is the taxonomy and “great-white-shark” is the taxonomy term’s slug:

$term = get_term_by('slug', 'great-white-shark', 'fish');

echo $term->name;

This will print out the name of the term, which is “Great White Shark.”


Viewing all articles
Browse latest Browse all 60

Latest Images

Trending Articles



Latest Images