Wrap a chosen category name with div

get_term_by returns an object by default, so you could output the term name using

<?php 
    $term = get_term_by('name', 'foo', 'category');
    echo "<div>$term->name</div>";
 ?>

Leave a Comment