Answers for "get all terms slugs custom taxonomy"

PHP
0

show all terms of a custom taxonomy

$terms = get_terms( array(
  'taxonomy' => 'taxonomy_name_or_slug',
  'hide_empty' => true,
) );
foreach ($terms as $term){
  echo $term->slug;
  echo $term->name;
  echo "<br><br>";
}
Posted by: Guest on July-20-2020
0

get taxonomy term id from slug - WordPress

<?php 
    $term = get_term_by('slug', $slug, 'category'); 
    $name = $term->name; 
    $id = $term->term_id;
?>
Posted by: Guest on September-23-2021

Code answers related to "get all terms slugs custom taxonomy"

Browse Popular Code Answers by Language