2010-06-15 90 views
0

我正在开发一些ajax脚本并使用wordpress,我的问题是:有没有一种方法可以以某种方式从wordpress函数中提取注释url?我使用的循环函数看起来像:从wordpress函数中提取注释url

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

的,这个HTML输出如下所示:

<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&post=17546" title="Edit post">Edit</a> 

不过,我只在SRC(http://www.somepage.com/staging/2010/06/15/sadfasfregw/#respond)感兴趣。有没有办法从那里得到它,然后在以后的参考中使用它?在WordPress中是否存在某种功能或类似的功能?

回答

1
<?php $comments_url = get_permalink() . '#respond'; ?> 
+0

感谢代码运行良好。 – Pavel 2010-06-15 10:23:37