[Resolved] Text before the button send comments

Home Forums Support [Resolved] Text before the button send comments

Home Forums Support Text before the button send comments

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #703756
    Diogenes

    Hi.

    I need to add text before the comment button.

    This post shows how to place it after the button, but I can not find a reference on how to place it before (between the comments box and the send button)

    Thanks for the help.

    GeneratePress 2.1.4
    GP Premium 1.7.2
    #704103
    David
    Staff
    Customer Support

    Hi there,

    you can use this filter:

    // Add content before comment form submit button
    function filter_comment_form_submit_button( $submit_button, $args ) {
        // make filter magic happen here...
        $submit_before = '<div class="custom-class">my content</div>';
        return $submit_before . $submit_button;
    };
     
    // add the filter
    add_filter( 'comment_form_submit_button', 'filter_comment_form_submit_button', 10, 2 );

    https://docs.generatepress.com/article/adding-php/

    just need to add your HTML to the $submit_before example includes a div container with a custom class which can you change to whatever you need for styling.

    #704590
    Diogenes

    Thanks David, it worked perfect.

    Greetings.

    #704608
    David
    Staff
    Customer Support

    That’s great. Glad to be of help

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