Collapse-o-matic插件和Wordpress注释如何循环?
我正在尝试让这个插件“Collapse-O-Matic”与wordpress网站的评论区一起工作。这个插件基本上可以折叠和扩展一个部分,但我特别需要它做的是折叠和扩展单个注释,而不是整个注释部分 我找到了在哪里做这件事,并且我能够添加它,但它只是将折叠添加到第一条注释“comment_text()”中,而不是添加到其余的注释中,我认为这意味着我需要添加某种循环,这就是我被卡住的地方 代码如下:Collapse-o-matic插件和Wordpress注释如何循环?,wordpress,loops,plugins,Wordpress,Loops,Plugins,我正在尝试让这个插件“Collapse-O-Matic”与wordpress网站的评论区一起工作。这个插件基本上可以折叠和扩展一个部分,但我特别需要它做的是折叠和扩展单个注释,而不是整个注释部分 我找到了在哪里做这件事,并且我能够添加它,但它只是将折叠添加到第一条注释“comment_text()”中,而不是添加到其余的注释中,我认为这意味着我需要添加某种循环,这就是我被卡住的地方 代码如下: <span class="collapseomatic" id="comments&l
<span class="collapseomatic" id="comments<?php the_ID(); ?>">Expand</span>
<span id="swap-comments<?php the_ID(); ?>" class="collapseomatic" style="display: none;">Collapse</span>
<div id="target-comments<?php the_ID(); ?>" class="collapseomatic_content">
<?php comment_text() ?>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
<?php if (1): // 'div' != $args['style'] ) : ?>
</div>
<?php endif; ?>
</div>
如果你没有使用实时评论插件,比如Livefyre或discus,下面的代码应该可以做到这一点:
<?php do_shortcode('[expand title="read more" swaptitle="read less"]'.comments_template().'[/expand]'); ?>
如果你没有使用实时评论插件,比如Livefyre或discus,下面的代码应该可以做到这一点:
<?php do_shortcode('[expand title="read more" swaptitle="read less"]'.comments_template().'[/expand]'); ?>