Powrót do Dev Notes

tytuł kategorii custom post


<h2>Kategoria: <span><?php $term_list = wp_get_post_terms($post->ID, 'custom-category', array("fields" => "names")); echo $term_list[0]; ?></span></h2>

<?php
//Returns Array of Term Names for "my_taxonomy"
$term_list = wp_get_post_terms($post->ID, 'postepowania-category', array("fields" => "names"));
print_r($term_list);
?>

pobranie parent name custom taxonomy:


<?php
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$parent = get_term($term->parent, get_query_var('taxonomy') );
echo $parent->name;
?>

Wordpress