• Resolved Morphim

    (@morphim)


    Hello.
    I wonder if it’s possible to change the comma between the category list meta non-destructively?
    The single post page displays a list of associated categories, each separated with a comma.

    I’ve found the code that features this in inc/structure/post-meta (around line 164)
    If I edit the main theme file, it changes.
    However, if i copy the post-meta file to my child theme with the same folder structure, it doesn’t work.

    I’ve also copied this function to my child functions.php but this doesn’t work either.

    I’m no coder so am sure it’s something stupid I’m doing so any help greatly appreciated.

    Thanks very much in advance. I’m sure answering stupid questions is a full time job ; )

    • This topic was modified 5 years, 7 months ago by Morphim.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Morphim

    (@morphim)

    Ah, man!!
    Don’t worry. I’d somehow reverted to the main theme rather than the child, which is why my child edits weren’t having any effect. Not sure how that happened but I’ve fixed it now.

    Thanks all the same (before you had to indulge me : )

    • This reply was modified 5 years, 7 months ago by Morphim.
    Theme Author Tom

    (@edge22)

    This is the most update-safe way to change that, just in case anyone else is wondering:

    add_filter( 'generate_category_list_output', function( $output ) {
        $categories_list = get_the_category_list( ',' );
    
        if ( $categories_list ) {
            printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
                esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
                $categories_list
            );
        }
    } );

    Then of course change the comma to whatever 🙂

    How to hide the featured image from the single post?

    If I hide, Does it affect my website SEO?

    Theme Author Tom

    (@edge22)

    Hi there,

    Any chance you can open a new support topic? We’ll be happy to provide some code for you 🙂

    Thanks!

    Thread Starter Morphim

    (@morphim)

    Can I just add, for anyone else looking at this, that the code goes within the functions.php of a child theme.

    Thanks very much, Tom. Your theme and support is second to none : )

    Theme Author Tom

    (@edge22)

    Thank you! Really appreciate that 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change comma divider between category meta’ is closed to new replies.