- This topic has 9 replies, 4 voices, and was last updated 4 years, 6 months ago by David.
-
AuthorPosts
-
August 13, 2019 at 6:05 am #982835dmmaso
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
August 13, 2019 at 11:18 am #983261TomLead DeveloperLead DeveloperHi 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 π
August 14, 2019 at 1:53 am #983709dmmasoHi Tom,
Exactly where did I put the code now in the functions.php file?
Thanks for your help.
August 14, 2019 at 8:26 am #984102LeoStaffCustomer SupportSo 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 π
August 14, 2019 at 8:55 am #984125dmmasoHi 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
August 14, 2019 at 4:38 pm #984417TomLead DeveloperLead DeveloperHi 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 π
October 18, 2019 at 8:31 am #1038259dmmasoHi,
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
October 18, 2019 at 6:04 pm #1038526DavidStaffCustomer SupportHi 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
October 21, 2019 at 2:29 pm #1040727dmmasoGreat! Thanks for the patience! π
October 22, 2019 at 4:08 am #1041100DavidStaffCustomer SupportGlad we could be of help
-
AuthorPosts
- You must be logged in to reply to this topic.