How to get custom texonomy in wordpress custom theme

Once custom taxonomies have been created, they can be easily managed and used on a WordPress website. The process for managing custom taxonomies is similar to the default categories and tags.

index.php / page.php

<?php 

$cat = get_terms([
    'taxonomy' => 'news_texonomy', 
   // 'hide_empty' => false // return that category where no post add
   'orderby' => 'name',
   'order' => 'DESC'
]);

foreach ($cat as $key => $category) {
   echo '<a href="'.get_category_link($category->term_id).'">'.$category->name.'</a><br/>';
}

?>

This plugin create feature in wordpress category for adding thumbnails in wordpress categories whether it can be post category or custom texonomy.

$taxonomy_img = get_taxonomy_image($category->term_id);

style="background-image:url(<?php echo $taxonomy_img; ?>)"

 

Leave a Reply