Jump to content

Adding a hyperlink to every comment


PauloCot

Recommended Posts

Here is an image of my comment format: http://oi40.tinypic.com/8w07jt.jpg

 

The hyperlink to each individual comment is the date and time with the url in the format of, for example: /nottingham/#comment-184

After going through my comment templates I found that these two functions do the following,

 

get_comments_link : Retrieves the link to the current post comments

AND

comments_link: Displays the link to the current post comments

 

The problem is I have no idea where to include these functions so it creates a hyperlink to every comment within every comment. Once this link has been created I'd also like to assign a div to it so I can format it to be in the bottom right corner of each comment.

My final goal is to manipulate the link so rather than the comment link itself it will automatically work in the facebook.com/sharer.php which I feel I can do myself once I figure out the previous part. Essentially it will be a share on facebook button, but I have found no plugins which do this yet and thought describing it as a hyperlink would be an easier way to explain what I'm trying to do.

Elsewhere I've been told the following: but not sure how to implement this...

In functions.php I'd add a 
 filter to return the desired link, including the tag you need. Note that this is a filter, not a function. There is function with the same name, but it's part of WordPress itself. Use the filter to add a div to the existing link. Then style the new div to position it where you want it. I notice that the Photoria theme repositions the Reply link, which is coded at the bottom but displayed at the top. In the same way, your new will be coded at the top but displayed at the bottom. Also see
in the Codex. Add the new div to $link before returning it. The new div will need a class attribute so that you can work with it in CSS to make it look the way you want.

 

 

I hope I've made the question clear, please ask if I haven't. Thanks in advance!

Edited by PauloCot
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.