Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress(php)中的Disqs评论计数_Php_Wordpress_Comments_Disqus - Fatal编程技术网

Wordpress(php)中的Disqs评论计数

Wordpress(php)中的Disqs评论计数,php,wordpress,comments,disqus,Php,Wordpress,Comments,Disqus,我已经使用disks插件将disks合并到我的博客中 唯一的问题是,内置到我的主题中的原始评论数持续显示为“0条评论”。在functions.php中编辑此区域,因此我需要使用php调用disqs的注释计数,而不仅仅是它们提供的html 我对php不太在行,但到目前为止我已经做到了: /* post_meta_comments */ if($bd_data['post_meta_comments']): echo "<div class='post_meta_

我已经使用disks插件将disks合并到我的博客中

唯一的问题是,内置到我的主题中的原始评论数持续显示为“0条评论”。在functions.php中编辑此区域,因此我需要使用php调用disqs的注释计数,而不仅仅是它们提供的html

我对php不太在行,但到目前为止我已经做到了:

   /* post_meta_comments */
            if($bd_data['post_meta_comments']):
echo "<div class='post_meta_comments'><i class='icon-comments'><a href="<?php echo get_permalink($post->ID); ?>#disqus_thread">link</a></i></div>\n";
endif;
/*发表评论*/
如果($bd_数据['post_meta_comments']):
回音“\n”;
endif;
但这样做,网站将不会加载

我的示例帖子URL为:

这是未经编辑的原始代码:

    if($bd_data['post_meta_comments']):                
    echo "<div class='post_meta_comments'><i class='icon-comments'></i>\n";
comments_popup_link(__('0 Comments', 'bd'), __('1 Comment', 'bd'), '% '.__('Comments', 'bd'));                
    echo "</div>\n";             
    endif;
if($bd_数据['post_meta_comments']):
回音“\n”;
注释弹出链接(uuu('0注释','bd'),uuuuu('1注释','bd'),'%。uuuu('注释','bd'));
回音“\n”;
endif;

您的
echo
语句存在语法问题。尝试
echo“\n”当字符串包含在双引号字符中时,使用反斜杠转义字符串中的双引号字符,即
\“
。请注意,使用串联运算符
.Hi-仍然存在同样的问题。这是我没有尝试更改任何内容时的原始代码:
if($bd_data['post_meta_comments']):echo“\n”;注释弹出链接(uuu('0注释','bd'),uuuuu('1注释','bd'),'%。uuuu('注释','bd'));回音“\n”;endif很难阅读注释中的代码。(我这样做只是因为我没有提出你问题的解决方案。)你可以更新你的问题(因为还没有答案)。好的,在那里添加了-有什么想法吗?谢谢