Php 覆盖Wordpress主题';s的明星评级和默认的商业评级

Php 覆盖Wordpress主题';s的明星评级和默认的商业评级,php,css,wordpress,woocommerce,themes,Php,Css,Wordpress,Woocommerce,Themes,我的WordPress主题(“功能”)使用了一个丑陋的“进度条”式评级系统,它覆盖了默认的WooCommerce星级评级。见下文: 就我的一生而言,我不知道如何删除它,并用默认/原始的WooCommerce明星评级取代它,这些评级实际上看起来像明星(我相信是真棒的字体?) 我认为需要做的是以某种方式覆盖或优先考虑WooCommerce明星评级css而不是主题。最终,我希望所有的进度条(商店页面和单个产品页面,审查提交表单)都被默认的WordPress stars所取代,但是目前我可以满足于只在

我的WordPress主题(“功能”)使用了一个丑陋的“进度条”式评级系统,它覆盖了默认的WooCommerce星级评级。见下文:

就我的一生而言,我不知道如何删除它,并用默认/原始的WooCommerce明星评级取代它,这些评级实际上看起来像明星(我相信是真棒的字体?)

我认为需要做的是以某种方式覆盖或优先考虑WooCommerce明星评级css而不是主题。最终,我希望所有的进度条(商店页面和单个产品页面,审查提交表单)都被默认的WordPress stars所取代,但是目前我可以满足于只在商店页面上,在该页面上,评级(进度条)显示在产品的照片下

我在
Function->Includes->Integrations->woocommerce->css->woocommerce.css
中找到了控制(创建?)进度条的css代码,但是,我在同一css文件夹中的woocommerce.less中也发现了一些可疑的代码

以下是我在woocommerce.css中找到的代码:

star-rating {
width: 80px;
height: 1em;
background: #eaeaea;
-webkit-border-radius: 3.631em;
border-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
clear: both;
}
.star-rating span {
background: #52a0cd;
height: 100%;
overflow: hidden;
float: left;
text-indent: -999em;
-webkit-box-sizing: border-box;
/* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box;
/* Firefox, other Gecko */
box-sizing: border-box;
/* Opera/IE 8+ */
-webkit-border-radius: 3.631em;
border-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.star-rating span span {
display: none;
}
p.stars {
overflow: hidden;
zoom: 1;
}
p.stars span {
width: 80px;
height: 16px;
position: relative;
float: left;
background: #eaeaea;
-webkit-border-radius: 3.631em;
border-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
p.stars span a {
float: left;
position: absolute;
left: 0;
top: 0;
width: 16px;
height: 0;
padding-top: 16px;
overflow: hidden;
}
p.stars span a:hover,
p.stars span a:focus {
background: #52a0cd;
-webkit-border-radius: 3.631em;
border-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
p.stars span a.active {
background: #52a0cd;
-webkit-border-radius: 3.631em;
border-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
p.stars span a.star-1 {
width: 16px;
z-index: 10;
-webkit-border-top-left-radius: 3.631em;
-webkit-border-bottom-left-radius: 3.631em;
border-top-left-radius: 3.631em;
border-bottom-left-radius: 3.631em;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
p.stars span a.star-2 {
width: 32px;
z-index: 9;
}
p.stars span a.star-3 {
width: 48px;
z-index: 8;
}
p.stars span a.star-4 {
width: 64px;
z-index: 7;
}
p.stars span a.star-5 {
width: 80px;
z-index: 6;
}
…以下是我在woocommerce.less中发现的内容:

   // Single product
    .single-product {
    .summary {
            .woocommerce-product-rating {
                .clearfix;
                .star-rating {
                    float: left;
                    margin: .327em 0 0;
                }
                .woocommerce-review-link {
                    float: right;
                    display: block;
                }
            }
    // General WooCommerce
    .star-rating {
        width:80px;
        height: 1em;
        background: @border_main;
        .border_radius(3.631em);
        clear:both;
        span {
            background: @color_links;
            height:100%;
            overflow: hidden;
            float: left;
            text-indent: -999em;
            .borderbox;
            .border_radius(3.631em);
            span {
                display: none;
            }
        }
    }

    p.stars {
        overflow: hidden;
        zoom: 1;
        span {
            width: 80px;
            height: 16px;
            position: relative;
            float: left;
            background: @border_main;
            .border_radius(3.631em);
            a {
                float: left;
                position: absolute;
                left: 0;
                top: 0;
                width: 16px;
                height: 0;
                padding-top: 16px;
                overflow: hidden;
            }
            a:hover, a:focus {
                background: @color_links;
                .border_radius(3.631em);
            }
            a.active {
                background: @color_links;
                .border_radius(3.631em);
            }
            a.star-1 { width: 16px; z-index: 10; .border_radius_left(3.631em); }
            a.star-2 { width: 32px; z-index: 9; }
            a.star-3 { width: 48px; z-index: 8; }
            a.star-4 { width: 64px; z-index: 7; }
            a.star-5 { width: 80px; z-index: 6; }
        }
    }
…以及更多的小部件区域、评论等

我已经找到了一些关于如何用主题覆盖默认的WooCommerce明星评级的帖子,但我找不到任何相反的方法。我确实遇到过这样的情况: 然而这对我来说不起作用

任何帮助都将不胜感激。谢谢大家!

编辑: 我被告知这可能是由functions.php文件引起的。下面是wp content->themes->Function Child->functions.php中的代码

<?php
if ( ! defined( 'ABSPATH' ) ) exit;

/*-----------------------------------------------------------------------------------*/
/* Start WooThemes Functions - Please refrain from editing this section */
/*-----------------------------------------------------------------------------------*/

// WooFramework init
require_once ( get_template_directory() . '/functions/admin-init.php' );

/*-----------------------------------------------------------------------------------*/
/* Load the theme-specific files, with support for overriding via a child theme.
/*-----------------------------------------------------------------------------------*/

$includes = array(
                'includes/theme-options.php',               // Options panel settings and custom settings
                'includes/theme-functions.php',             // Custom theme functions
                'includes/theme-actions.php',               // Theme actions & user defined hooks
                'includes/theme-comments.php',              // Custom comments/pingback loop
                'includes/theme-js.php',                    // Load JavaScript via wp_enqueue_script
                'includes/sidebar-init.php',                // Initialize widgetized areas
                'includes/theme-widgets.php',               // Theme widgets
                'includes/theme-plugin-integrations.php'    // Plugin integrations
                );

// Allow child themes/plugins to add widgets to be loaded.
$includes = apply_filters( 'woo_includes', $includes );

foreach ( $includes as $i ) {
    locate_template( $i, true );
}
/*-----------------------------------------------------------------------------------*/
/* You can add custom functions below */
/*-----------------------------------------------------------------------------------*/

我对WordPress不太熟悉,但默认的WordPress评级系统很可能在php文件(可能是functions.php)中被覆盖,不能通过修改CSS来修复。如果这看起来很可能,您是否可以更新您的问题以包含相关的php代码。谢谢你!希望这能有所帮助……我对WordPress不是很熟悉,但很可能默认的WordPress评级系统在php文件(可能是functions.php)中被覆盖,并且不能通过修改CSS来修复。如果这看起来很可能,您是否可以更新您的问题以包含相关的php代码。谢谢你!希望这有助于。。。
<?php
if ( ! defined( 'ABSPATH' ) ) exit;

global $woo_options;

add_theme_support( 'woocommerce' );

// Disable WooCommerce styles
if ( version_compare( WOOCOMMERCE_VERSION, '2.1' ) >= 0 ) {
    // WooCommerce 2.1 or above is active
    add_filter( 'woocommerce_enqueue_styles', '__return_false' );
} else {
    // WooCommerce less than 2.1 is active
    define( 'WOOCOMMERCE_USE_CSS', false );
}

// Load WooCommerce stylsheet
if ( ! is_admin() ) { add_action( 'wp_enqueue_scripts', 'woo_load_woocommerce_css', 20 ); }

if ( ! function_exists( 'woo_load_woocommerce_css' ) ) {
    function woo_load_woocommerce_css () {
        wp_register_style( 'woocommerce', esc_url( get_template_directory_uri() . '/includes/integrations/woocommerce/css/woocommerce.css' ) );
        wp_enqueue_style( 'woocommerce' );
    } // End woo_load_woocommerce_css()
}