Advertisement
kobial8

Beautify Archive Category Tag Template

Dec 23rd, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. Add the following code to remove annoying Category: / Tag: when user hit any category or tag:
  2.  
  3. add_filter( 'get_the_archive_title', function ($title) {
  4.  
  5.     if ( is_category() ) {
  6.  
  7.             $title = single_cat_title( '', false );
  8.  
  9.         } elseif ( is_tag() ) {
  10.  
  11.             $title = single_tag_title( '', false );
  12.  
  13.         } elseif ( is_author() ) {
  14.  
  15.             $title = '<span class="vcard">' . get_the_author() . '</span>' ;
  16.  
  17.         }
  18.  
  19.     return $title;
  20.  
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement