i've following code in attempt print second top category , category of search result:
$category = get_the_terms( $post_id , 'manualknowledgebasecat'); $number = $category[0] -> term_id; echo get_category_parents( $numero, true, ' » ' );
the previous code print complete list of categories, want print second category , current category. example: if search result has categories: products >> nameoftheproduct >> manual >> configurations
want print nameoftheproduct
, configurations
. how can ?
thank you replies in advance.
best regards.
Comments
Post a Comment