Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter finebyme

    (@finebyme)

    I managed to remove the category

    find this code in entry-header.php

    $show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );

    and change true to false

    Anonymous User 14254218

    (@anonymized-14254218)

    You can do this in the functions.php file of your theme.
    TwentyTwenty uses filters so you do not have to touch the actual theme code.

    Simply add the following lines to the bottom of your functions.php file.

    
    add_filter('twentytwenty_show_categories_in_entry_header', '__return_false'); // removes category in entry header
    add_filter('twentytwenty_post_meta_location_single_top', '__return_empty_array'); // removes author, post-date, comment count, sticky status in post head
    add_filter('twentytwenty_post_meta_location_single_bottom', '__return_empty_array'); // removes tags in post footer
    

    Instead of using '__return_empty_array' you can also use a function to define what should actually be shown.

    
    function wps_display_custom_tags ($post_meta) {
      // delete meta tags you do not want to display
      return array( 'author', 'post-date', 'comments', 'sticky', 'tags');
    }
    add_filter('twentytwenty_post_meta_location_single_top', 'wps_display_custom_tags');
    

    Be aware if you do not use a child theme which inherits TwentyTwenty, you will have to apply the code changes again if you ever update the theme.

    • This reply was modified 5 years, 3 months ago by Anonymous User 14254218.
    Thread Starter finebyme

    (@finebyme)

    I tried the first code you suggested and it worked.

    Thanks for the help

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide Author Name, Post Date & Categories’ is closed to new replies.