• ResolvedModerator t-p

    (@t-p)


    Is there a filter for the followings:

    (1). filter to remove tags from below the excerpts from home page, search page.

    (2). filter to display categories below the post on single page ONLY (i.e., NOT top of single post or excerpts)

Viewing 10 replies - 1 through 10 (of 10 total)
  • Anonymous User 14254218

    (@anonymized-14254218)

    Moderator t-p

    (@t-p)

    Thanks for reply Rauai.

    I reviewed that thread before posting. you have provided very useful filters in it.

    But my question is little different.

    1. I want to remove tags ONLY from ALL excerpts NOT anywhere else.
    2. I want to move categories to post bottom. Also I want to remove them altogether from ALL excerpts.

    • This reply was modified 4 years, 11 months ago by t-p.

    @t-p

    1. Try:

    
    add_filter( 'twentytwenty_post_meta_location_single_bottom', function( $arr ) {
    	if ( is_singular() ) {
    		return $arr;
    	}
    
    	return array();
    } );
    

    2. To remove from excerpts:

    
    add_filter( 'twentytwenty_show_categories_in_entry_header', function( $val ) {
    	if ( is_singular() ) {
    		return true;
    	}
    
    	return false;
    } );
    

    There are no filters to move it at the bottom. You’ll need to modify the files…

    • This reply was modified 4 years, 11 months ago by acosmin.
    Moderator t-p

    (@t-p)

    Thanks a lot acosmin. It works. Very handy snippets.

    About moving categories to post bottom, you said

    You’ll need to modify the files…

    .

    Which file that would be? Thanks again.

    It depends on where exactly you want it to show up. Could you please make a screenshot and draw on it where it should be located… it would help.

    @acosmin I want also to remove the tags (post category and comment count) from the top of a single post. Do you have a CSS I could use to achieve the same results instead of a filter as a filter will require to modify the theme.
    A simple CSS would do for me if you got one.

    Thanks

    @albertkents try:

    .singular .entry-categories {
        display: none;
    }
    Moderator t-p

    (@t-p)

    It depends on where exactly you want it to show up.

    Below posts on singular (NOT EXCERPTS)

    @t-p Replace what I mentioned at point 1 with:

    
    add_filter( 'twentytwenty_post_meta_location_single_bottom', function( $arr ) {
    	if ( is_singular() ) {
    		$arr[] = 'categories';
    		
    		return $arr;
    	}
    
    	return array();
    } );
    
    • This reply was modified 4 years, 11 months ago by acosmin.
    Moderator t-p

    (@t-p)

    Thanks acosmin! Great stuff!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove tags from below the excerpts’ is closed to new replies.