Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

How to change “Leave a comment…” from H4 to P?

  • Hello Team,

    Happy New Year!

    On a post where there are existing comments (Example: https://charbelnemnom.com/secure-azure-file-shares-entra-private-access/), the “Leave a comment…” href #respond link with the class=”smooth-scroll” is set to <h4>. I need to change it to <h3> or <p>.

    <h4><a href="#respond" class="smooth-scroll">Leave a comment…</a></h4>

    Google Pagespeed is complaining that Heading elements are not in a sequentially descending order.
    See attached screenshot for more details: https://app.screencast.com/QvESqNSXcvrqy

    I already have the following filter to change the default “Leave a Comment” text, but not the headings.

    add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
    function tu_custom_leave_comment() {
        return 'Let us know what you think, or ask a question...';
    }

    I came across the following topic: https://generatepress.com/forums/topic/help-with-changing-a-heading/, which applies to the custom text “Let us know what you think, or ask a question…“, but it does not apply to the “Leave a comment…” above.

    Your help is highly appreciated.

    Thank You!

  • Hi there,

    Happy New Year!

    This line:

    
    <h4><a href="#respond" class="smooth-scroll">Leave a comment…</a></h4>
    

    is not output by the theme by default.

    Are you using a child theme? If so, please check the comments.php file in your child theme directory and make the changes there.

    Let me know how it goes!

  • Hello @Alvind,

    I appreciate your support.

    Yes, I am using a child theme for GeneratePress, but I only have the functions.php file.
    How can I change it under comments.php?

    I checked the comments.php file under the parent GeneratePress theme, and I didn’t find any markup related to <h4><a href="#respond" class="smooth-scroll">Leave a comment…</a></h4>.

    Could you please provide more detailed information?

    Thanks!

  • Finally, I found out where it’s coming from. It was under Elements > Hook “generate_below_comment_title”. I changed it to h3.
    Thanks!

  • Glad to hear that! 🙂

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