[Resolved] Change H3 in comments

Home Forums Support [Resolved] Change H3 in comments

Home Forums Support Change H3 in comments

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #1690146
    Ying
    Staff
    Customer Support

    It should work for both, no matter the post has comments or not.

    Could you share the link of your site in question?

    #1690164
    Jörg

    Here is a link for a post with comment: https://tri-it-fit.de/motivationsprueche-sport/
    And here is one without a comment: https://tri-it-fit.de/fitnessuebung-turkish-get-up/

    #1690199
    Ying
    Staff
    Customer Support

    Let’s try the steps below:

    1) Disable your cache plugin and clear your cache.

    2) Make sure this is the only code you added to your child theme to eliminate conflicts from other codes.

    #1690543
    Jörg

    I did both. Cleared the cache, and it is the only code I added.

    #1691457
    Ying
    Staff
    Customer Support

    I can see both of them are working now, no matter there’s comment or no comment 🙂
    https://www.screencast.com/t/v1aoby8k1K

    #1691621
    Jörg

    Sorry. Now I know what you mean. 😅 Yes the “leave a comment” part is no longer an H3 headline. But the “x thought on..” part is still H3.
    In this case I still have a problem with the headline structure because in many articles there is no H2 headline.

    That’s why I asked for both headlines in the comment section (https://generatepress.com/forums/topic/change-h3-in-comments/#post-1688542)

    #1691680
    Ying
    Staff
    Customer Support

    The topic starter is using a child theme, so this is how he managed to change the H3 tag of the comment title:
    https://wp-puzzle.com/docs/basic/change-h3-in-comments-list-and-form.html

    If you are not using child theme, try this:

    add_filter( 'generate_comments_title_output', function( $output, $comments_title ) {
        return sprintf(
            '<strong class="comments-title">you custom comment title</strong>',
            esc_html( $comments_title )
        );
    }, 10, 2 );
    #1695477
    Jörg

    Thanks for your help. The last solution is working. 🙂

    #1696622
    Ying
    Staff
    Customer Support

    Nice!

    Glad to hear that 🙂

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.