Archived topic
click to comment button in post
5 replies · Started by Melissa on May 2, 2020
Hello,
I have the tasty theme and would like to add a "click to comment" button at the end of each individual post that links to the comment box. Can you instruct me on how to do this? I know how to add a button, but I don't know how to link it to the comment box.
As an example, my friend's site stampinpretty.com has a red "click to comment" button at the end of each one of her posts, and that is what I would like to add to mine.
Thank you,
Melissa
Hi there,
What if we move the comment form to above all the existing comments?
https://docs.generatepress.com/article/move-the-comment-form-above-comments/
Let me know :)
Hi Leo,
I tried to do as you suggested, but it did not work. I installed a child theme and tried to paste the code into the css, but it stated the markup is not allowed in css. Is there someplace else that the code is supposed to go other than the additional css in the child theme customization?
Thank you,
Melissa
Hi there,
download the zip here:
https://gist.github.com/generatepress/9a0f6cf705cd594ab22296c6a8e8de3f#file-comments-php
And copy the comments.php file into your Child Theme folder. You will need to access your site using FTP or your servers control panel.
Hi David!
Thank you for the response. I did as you instructed, and it crashed my site. Thankfully, I was able to get it fixed with the help of my hosting site, and all is good again.
For now, I am just adding a link with an anchor in the end that jumps to the comment section.
Thank you,
Melisa
Try creating a new hook element:
https://docs.generatepress.com/article/hooks-element-overview/
Add this as the content:
<a href="#comment" class="button">Jump to comments</a>
Select the after_content hook.
Then set the display rules to Posts.