[Resolved] Reply link at the bottom of the comments

Home Forums Support [Resolved] Reply link at the bottom of the comments

Home Forums Support Reply link at the bottom of the comments

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #982835
    dmmaso

    Hi,

    I would like to put the reply link of the comments at the bottom of the comment. It’s possible?

    Attached capture

    https://drive.google.com/file/d/1Wk10l7VZ3lNsnLAwDE4qbSFj-5_eZlNU/view?usp=sharing

    Thanks in advance

    #983261
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Right now this is difficult, as there are no hooks in that area.

    I’ve just committed a change for GP 2.4, which introduces a hook there: https://github.com/tomusborne/generatepress/blob/release/2.4/inc/structure/comments.php#L84-L90

    With that hook, you’ll be able to do this:

    add_action( 'generate_after_comment_text', function( $comment, $args, $depth ) {
    	comment_reply_link( array_merge( $args, array(
    		'add_below' => 'div-comment',
    		'depth'     => $depth,
    		'max_depth' => $args['max_depth'],
    		'before'    => '<span class="reply">',
    		'after'     => '</span>',
    	) ) );
    }, 10, 3 );

    If you’d like, you can add that hook to your current version and begin using the above code right away πŸ™‚

    #983709
    dmmaso

    Hi Tom,

    Exactly where did I put the code now in the functions.php file?

    Thanks for your help.

    #984102
    Leo
    Staff
    Customer Support

    So first you will need to copy the comment.php file Tom linked above and add it in your child theme.

    Then you can add the code provided in your child theme’s function.php file (it’s empty by default).

    Let me know πŸ™‚

    #984125
    dmmaso

    Hi Leo,

    I have copied the comments.php and added the code to the functions file but the design changes completely and the comments disappear.

    Link: https://nergiza.pilvia.site/magnetotermico-diferencial-e-icp-no-todos-los-machetes-son-iguales/

    Thanks

    #984417
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Since we’re implementing this hook by default, there’s no need to copy the file into your child theme.

    Instead, you can just edit the core file in inc/structure/comments.php and add the hook in there.

    To make it easier, just copy the entire contents of the file (https://raw.githubusercontent.com/tomusborne/generatepress/release/2.4/inc/structure/comments.php) and replace the contents of your current file.

    Then you can use the hook I provided above πŸ™‚

    #1038259
    dmmaso

    Hi,

    Sorry for my ignorance, but I still don’t see how to solve this.

    I tried to do what you told me but I didn’t quite understand.

    Sorry for the inconvenience

    #1038526
    David
    Staff
    Customer Support

    Hi there,

    edit the file here inc/structure/comments.php – either by using the Appearance > Theme Editor or accessing that file via FTP in the Themes/GeneratePress folder.

    Once you in the file delete its entire content and replace it with the code that Tom provided here:

    https://raw.githubusercontent.com/tomusborne/generatepress/release/2.4/inc/structure/comments.php

    #1040727
    dmmaso

    Great! Thanks for the patience! πŸ™‚

    #1041100
    David
    Staff
    Customer Support

    Glad we could be of help

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