views:

7

answers:

1

Hi everyone. I'm developing some ajax script and using wordpress and my question is: is there a way to extract a comment url from a wordpress function somehow? The function I'm using in the loop looks like that:

<?php comments_popup_link('Discuss &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> <?php edit_post_link('Edit', '| ', ''); ?>

And the HTML output of that looks like this:

<a href="http://www.somepage.com/staging/2010/06/15/sadfasfregw/#respond" title="Comment on sadfasfregw"><span class="dsq-postid-17546">View Comments</span></a>| 
<a class="post-edit-link" href="http://www.somepage.com/staging/wp-admin/post.php?action=edit&amp;post=17546" title="Edit post">Edit</a>

However, I'm only interested in src (http://www.somepage.com/staging/2010/06/15/sadfasfregw/#respond). Is there a way to get it from there and then use it in later reference? Does some kind of function or anything like that exists in wordpress? Many thanks in advance for any responses!

+1  A: 
<?php $comments_url = get_permalink() . '#respond'; ?>
TheDeadMedic
Thanks that code worked great.
Pavel