Search
 
SCRIPT & CODE EXAMPLE
 

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' );
Comment

PREVIOUS NEXT
Code Example
Php :: Select All Data From MySql Database Table PHP Function 
Php :: laravel jobs cache file picking old job file 
Php :: multidimensional session-array 
Php :: eager load relationships on an existing model in route laravel 
Php :: session flash data (old input) 
Php :: Route::any 
Php :: all locales php 
Php :: php update json file 
Php :: shopware php get cookie 
Php :: PHP str_pad — Pad a string to a certain length with another string 
Php :: laravel csrf token or protection or laravel form 
Php :: how to select and deselect all items without use name in laravel 
Php :: Random select value on array factory Laravel 
Php :: laravel livewire refresh computed property 
Php :: how to update xampp php version 
Php :: Solution for unseting an array 
Php :: wordpress acf image array 
Php :: themeHeader 
Php :: phpfiddle 
Php :: pl sql php connect 
Php :: Laravel 9 Multiple File Upload 
Php :: get product price with thousands separator 
Php :: Access app.php values laravel 
Php :: command line that convert html to php file 
Php :: how to store api response to avariable in phpp 
Php :: how to write a php program for an electricity bill using if-else conditions 
Php :: vendor folder command for custom errors laravel 
Php :: php registration form and login in same page 
Php :: laravel 
Php :: laravel authentication 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =