Site logo

[Resolved] Remove commas between tags on post

Home Forums Support [Resolved] Remove commas between tags on post

Home Forums Support Remove commas between tags on post

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #515699
    Matthew

    I was wondering if it’s possible to remove the commas (“,”) between tags at the bottom of a post…
    I saw a couple questions on here that ask similar, but it also removes the commas on the categories listed.

    I tried to disable tags through layout > blog, and then insert after content using if page and then list the tags, but I get the comments there too, and then they are after the previous and next post links… tried to fix that by editing content_single.php, but it didn’t seem to work.

    Any help would be greatly appreciated.

    Thank you!

    #515883
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try this function here: https://gist.github.com/generatepress/18e41e03783b5c7e86402d429e64efc0

    Without this part:

    $categories_list = get_the_category_list( _x( '', 'Used between list items, there is a space after the comma.', 'generatepress' ) );
    	if ( $categories_list && $categories ) {
    		printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    			_x( 'Categories', 'Used before category names.', 'generatepress' ),
    			$categories_list
    		);
    	}

    Let me know.

    #515894
    Matthew

    Thanks for your reply.

    That gets rid of the commas in the tags, but also completely removes the categories, which I don’t want to do.

    #516071
    Leo
    Staff
    Customer Support

    Can you give this a shot? https://gist.github.com/leohsiang/87dcfe0defa207cdc025cb9004998ab4

    Let me know 🙂

    #516626
    Matthew

    That did it 🙂 Thank you very much!!

    #516712
    Leo
    Staff
    Customer Support

    No problem 🙂

    #1281283
    Dwayne

    Also want to do this.
    Getting error: “Cannot redeclare function generate_entry_meta.”

    Was attempting to add via code snippets.

    #1281291
    Leo
    Staff
    Customer Support

    You can actually use a filter for this now:
    https://docs.generatepress.com/article/generate_term_separator/

    Please open a new topic if you need further help with this.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Remove commas between tags on post’ is closed to new replies.