【发布时间】:2018-11-19 21:38:20
【问题描述】:
single-product.php woocommerce 文件中有一个通知 ,我看到了 cmets 的列表但是有这个通知
我还在我的主题中添加了 cmets.php
主题中的这个 cmets.php 文件
<?php
/*
* If the current post is protected by a password and the visitor has not yet
* entered the password we will return early without loading the comments.
*/
if ( post_password_required() )
return;
?>
<div id="comments" class="comments-area">
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'ivanhoe' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<ol class="commentlist">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 74,
) );
?>
</ol><!-- .comment-list -->
<?php
// Are there comments to navigate through?
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<nav class="navigation comment-navigation" role="navigation">
<h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'ivanhoe' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'ivanhoe' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'ivanhoe' ) ); ?></div>
</nav><!-- .comment-navigation -->
<?php endif; // Check for comment navigation ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="no-comments"><?php _e( 'Comments are closed.' , 'ivanhoe' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments -->
【问题讨论】:
-
如错误信息所述:您使用的主题缺少 cmets.php 模板文件。请让主题提供者包含此模板或自行创建 cmets 模板文件。
-
我自己是这个主题的设计者,我也在我的主题和模板中添加了 cmets.php 文件,但我在 single-product.php woocommerce 文件中有此通知,但我在 single-product.php 中没有此通知- post.php 文件
-
你能发布你的 cmets.php 文件吗?
-
您是否在任何插件和主题的任何地方使用此功能
comments_template()?签入所有插件 -
woocommerce 3.5.1 和 wordpress 4.9.8,是的,我在 single-post.php 中使用了 cmets_template
标签: php wordpress woocommerce