Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

show all custom taxonomy term & title with filter hook

<?php
$philosophy_footer_tag_heading = apply_filters('philosophy_footer_tag_heading', __('Tags', 'philosophy'));
$philosophy_footer_tag_items = apply_filters('philosophy_footer_tag_items', get_tags());
?>
<h3>
   <?php echo esc_html($philosophy_footer_tag_heading); ?>
</h3>
<div class="tagcloud">
   <?php
   if (is_array($philosophy_footer_tag_items)) {
      foreach ($philosophy_footer_tag_items as $pti) {
         printf('<a href="%s">%s</a>', get_term_link($pti->term_id), $pti->name);
      }
   }
   ?>
</div>
            
            Then add to functions.php this code.
            
function philosophy_footer_language_heading($title){
   if(is_post_type_archive('book')){
      $title = __('Languages', 'philosophy');
   }
   return $title;
}
add_filter( 'philosophy_footer_tag_heading', 'philosophy_footer_language_heading' );

function philosophy_footer_language_terms($tags){
   if(is_post_type_archive('book')){
      $tags = get_terms(array(
         'taxonomy'  => 'language',
         'hide_empty'=> false,
      ));
   }
   return $tags;
}
add_filter( 'philosophy_footer_tag_items', 'philosophy_footer_language_terms' );
 
PREVIOUS NEXT
Tagged: #show #custom #taxonomy #term #title #filter #hook
ADD COMMENT
Topic
Name
3+6 =