【问题标题】:Extracting comment url from wordpress function从wordpress函数中提取评论url
【发布时间】:2017-08-05 15:22:30
【问题描述】:

我正在开发一些 ajax 脚本并使用 wordpress,我的问题是:有没有办法以某种方式从 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中是否存在某种功能或类似的东西?

【问题讨论】:

    标签: wordpress


    【解决方案1】:
    <?php $comments_url = get_permalink() . '#respond'; ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 2010-10-19
      • 2014-08-18
      • 1970-01-01
      相关资源
      最近更新 更多