새 사용자 지정 테마에 Woocommerce 등급이 표시되지 않음
나는 새로운 커스텀 테마를 만들고 있다.woocommerce 플러그인을 설치했습니다.저는 xml 파일에서 제품을 Import하고 있습니다.저는 평가 기능을 테스트하려고 했습니다.워드프레스의 기본 테마인 2012년, 20대 청소년용입니다.커스텀 테마로 바꾸니까코멘트 섹션에 등급이 표시되지 않습니다.
스크린샷을 보세요.주석 섹션에는 텍스트 영역만 있습니다.
여기 제 코멘트 코드가 있습니다.php
<div class="comments">
<?php if (post_password_required()) : ?>
<p><?php _e( 'Post is password protected. Enter the password to view any comments.', 'html5blank' ); ?></p>
</div>
<?php return; endif; ?>
<?php if (have_comments()) : ?>
<h2><?php comments_number(); ?></h2>
<ul>
<?php wp_list_comments('type=comment&callback=html5blankcomments'); // Custom callback in functions.php ?>
</ul>
<?php elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p><?php _e( 'Comments are closed here.', 'html5blank' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
</div>
커스텀 테마를 사용하고 있는 경우는, WooCommerce 와 호환하기 위해서 WooCommerce 의 서포트를 선언할 필요가 있습니다.기본 WordPress 테마는 보통 WooCommerce와 호환되며 추가 없이 작동합니다.자세한 것은, https://woocommerce.com/document/third-party-theme-compatibility/ 를 참조해 주세요.
스텝 1: 테마의 'functions.php'에 추가합니다.
function custom_theme_setup() {
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'custom_theme_setup' );
2단계: 리뷰가 아직 표시되지 않으면 테마 페이지를 복사합니다.php'를 'woocommerce.display'로 지정합니다.루프를 제거합니다.<?php if(have_posts()): while(have_posts()): the_post(); ?>
그리고.<?php endwhile; endif; ?>
.교체하다the_content()
와 함께woocommerce_content()
.
이것으로 문제가 해결되는지 여부를 알려 주십시오.그렇지 않으면 새로운 'woocommerce'를 붙여넣습니다.질문에 있는 php의 내용.
커스텀 테마를 작성할 경우 템플릿을 woocommerce에서 커스텀 테마로 복사한 후 폴더 이름을 추가해야 합니다.woocommerce
커스텀 테마에 맞추어 주세요.
그 후 복사single-product-reviews.php
from plugins -> woocommerce -> 템플릿을 사용하여 새로 작성한 커스텀테마 폴더명에 붙여넣습니다.woocommerce
이제 필요에 따라 검토 템플릿을 사용자 정의할 수 있습니다.
WooCommerce 설정 문제일 수 있습니다.[ WooCommerce ]메뉴로 이동하여 [Settings]-> [ Products ]탭으로 이동합니다.등급 및 검토를 활성화하는 옵션을 찾을 수 있습니다.스크린샷을 확인해 주세요.
이게 도움이 되길 바라.
별 글꼴 패밀리 추가:
.star-rating {
font-family: star !important;
}
.star-rating span {
font-family: star !important;
}
언급URL : https://stackoverflow.com/questions/51497758/woocommerce-rating-not-showing-in-new-custom-theme
'it-source' 카테고리의 다른 글
워드프레스 $wpdb->get_results 및 num_rows (0) | 2023.03.27 |
---|---|
.docx, .pptx 등의 올바른 MIME 유형은 무엇입니까? (0) | 2023.03.27 |
스프링 데이터에서의 findBy와 findOneBy의 차이점 JPA (0) | 2023.03.27 |
Oracle 데이터베이스에 허용된 최대 연결 수를 확인하는 방법은 무엇입니까? (0) | 2023.03.27 |
URL 매개 변수가 있는 WordPress REST API 사용자 지정 끝점 (0) | 2023.03.27 |