wordpress get taxonomy of a post
<?php $term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
wordpress get taxonomy of a post
<?php $term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
search on taxonomy wordpress query
// We get a list taxonomies on the search box
function get_tax_by_search($search_text){
$args = array(
'taxonomy' => array( 'my_tax' ), // taxonomy name
'orderby' => 'id',
'order' => 'ASC',
'hide_empty' => true,
'fields' => 'all',
'name__like' => $search_text
);
$terms = get_terms( $args );
$count = count($terms);
if($count > 0){
echo "<ul>";
foreach ($terms as $term) {
echo "<li><a href='".get_term_link( $term )."'>".$term->name."</a></li>";
}
echo "</ul>";
}
}
// sample
get_tax_by_search('Foo');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us