Advertisement
fahimmurshed

Removes the tags in meta below the title

Feb 19th, 2022
1,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. // removes the tags in meta below the title
  2. add_filter( 'astra_post_tags', 'remove_tags_callback' );
  3. function remove_tags_callback(){
  4.     return ' ';
  5. }
  6.  
  7. add_action('wp', 'tags_call_back');
  8.  
  9. function tags_call_back(){
  10.     if( is_single() ){
  11.         add_action( 'astra_entry_bottom' , 'add_tags_callback');
  12.     }
  13. }
  14.  
  15. // display the tags with link at the respective action hook
  16.  
  17. function add_tags_callback(){
  18.         $output = '';
  19.         /* translators: used between list items, there is a space after the comma */
  20.         $tags_list = get_the_tag_list( '', __( ', ', 'astra' ) );
  21.         if ( $tags_list ) {
  22.             $output .= '<span class="tags-links">' . $tags_list . '</span>';
  23.         }
  24.         if( ! empty($tags_list)){
  25.             echo 'Tags: ' . $output . '';
  26.         }
  27.        
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement