Site logo

Archived topic

Change comment text and create anchor link to "Leave a comment"

19 replies · Started by Gianluca on August 29, 2018

Viewing posts 1–15 of 20

Hi,

in my blog I have articles with over 400 comments (see url attached), for this reason I would like to create an anchor link that, when clicked, goes to the "Leave a comment" section.

The anchor link should be placed at the end of the article after the text "430 comments on (article title). <a href="#anchorlink">New comment</a>" .

Do you know how I can implement this option?

Thank you in advance

Hi there,

You could use a Hook element in our Elements module.

Add a new hook and give it this content:

<a href="#respond">Leave a comment</a>

Then add to the after_content hook.

Then in Display Rules you can set it to only display in single posts.

Hope this helps :)

Thank you!

What if I'd like to place the anchor link after the text “430 comments... Leave a comment" only when there is at least 1 comment on single posts?

Hi David,

Excellent, thank you!

What if I'd like to give the anchor link the same styling as the other links of my website?

Also, is there a simple way to change the text "Leave a comment on..." and remove the post title?

Ok, thank you :)

No problem! :)

Hi - I also want to remove the post title from this text, but don't really understand what I need to do to achieve this. Please could you elaborate a little on the above.

That worked Thanks

You're welcome :)

Hi, Tom:

I made what you explained to create an anchor link to "Leave a Comment". The problem is that my anchor link doesn´t redirect me anywhere. Could you explain to me what am I doing wrong, please? http://lasimplicite.es

Otherwise, how can I style the link? I would like it to be right aligned and with another font.

Thank you very much!!

Hi there,

What functions are you using to alter the link?

Hi Tom,

I have used a Hook element in your Elements module.
I have added a new hook and give it this content: <a href="#respond">Leave a comment</a>
Then I have added it to the after_content hook.
Then in Display Rules I have set it to only display in single posts.

That´s all! Sorry for my lack of knowledge...

Thanks!!

This archived topic is closed to new replies.