[Resolved] Change h3 tag comment title w/ child theme

Home Forums Support [Resolved] Change h3 tag comment title w/ child theme

Home Forums Support Change h3 tag comment title w/ child theme

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2352604
    finanzbeben

    Dear GP Team

    I came across older posts regarding the change of the HTML heading in the comment title tag.

    As I learned, I have installed the child theme and copied the comment.php snippet to the child.
    Accordingly, I have also changed the HTML heading from H3 to H2 just to make sure that this solution works.

    See also the picture from the code in the child theme: https://ibb.co/khpMKkS

    The thing ist, this doesn’t change a thing.

    Do I miss something here? I simply need to install the child theme, copy comment php from the parent theme and adjust, right? Parent theme still activated and NOT the child theme, or am I wrong here?

    Kind regards and thanks for your support

    #2352736
    Ying
    Staff
    Customer Support

    Hi there,

    If you go with the child theme method, you don’t need to add a filter to the functions.php file.

    The steps would be:

    1. Take a copy of comments.php from the GeneratePress theme, and paste it to your child theme folder.
    2. Change this line <h2 class="comments-title">%s</h2> of the child theme comments.php file to <h3 class="comments-title">%s</h3>.
    3. Activate the child theme at appearance > themes.

    #2352934
    finanzbeben

    Hi Ying,

    Thanks for your answer.

    I will try. Is there another method? I thought, it’s only possible to use a child theme.

    Kind regards

    #2353576
    Ying
    Staff
    Customer Support

    If you install a child theme just for this, then don’t.

    The PHP snippet would work with the parent theme:
    https://docs.generatepress.com/article/generate_comments_title_output/

    You can install a plugin called code snippet, then add this PHP snippet to the plugin.

    #2354393
    finanzbeben

    Actually, that did the job for me. Thank you so much. Better approach.

    #2354549
    Ying
    Staff
    Customer Support

    You are welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.