php - single-product.php woocommerce中有一条通知,图片在描述中
问题描述
single-product.php woocommerce 文件中有一个通知,我看到评论列表但有这个通知
我还在我的主题中添加了comments.php
主题中的这个 comments.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 -->
解决方案
在 functions.php 文件中添加此代码
add_theme_support('woocommerce');
推荐阅读
- reactjs - handleExpand 函数正在更改网格中的多个 Material UI 卡片
- spring - [] 中构造函数的参数 0 需要一个无法找到的 [] 类型的 bean
- python - Linux 上的 Jupyter:URL 错误:
我目前正在学习如何使用 pandas 库的教程,我可以解决这个错误。我对整个场景还是新手,所以我不完全确定发生了什么或如何解释这个错误:
----------------------------
- javascript - 将 mailgun 合并到控制器中
- c# - Try and Catch 块不扔任何东西
- php - PHP 回声样式
- java - 如何在底部工作表对话框片段中设置文本按钮?
- python - pycharm 刽子手游戏中的问题。这里是初学者(显然)。TypeError: 'builtin_function_or_method' 类型的对象没有 len()
- c++ - 创建 GL_TEXTURE_2D_ARRAY 后访问冲突
- python - 为什么加密中的AES加密会产生汉字