【问题标题】:How do I change the review ratings from S's in WooCommerce?如何更改 WooCommerce 中 S 的评论评级?
【发布时间】:2021-09-20 19:20:14
【问题描述】:

如何将 WooCommerce 中的评论评级图像从当前的“S”更改为实际的星级图像?
经过良好的谷歌搜索后,我尝试了这个:Replace theme ratings with WooCommerce stars
但它不起作用。它只是将 S 更改为小盒子。

当前的 CSS:

.woocommerce .star-rating {
    float:right;
    overflow:hidden;
    position:relative;
    height:1em;
    line-height:1;
    font-size:1em;
    width:5.4em;
    font-family: HelveticaNeue-Light, Helvetica Neue Light;
}
.woocommerce .star-rating:before {
    content:"\73\73\73\73\73";
    color:#d3ced2;
    float:left;
    top:0;
    left:0;
    position:absolute;
}
.woocommerce .star-rating span {
    overflow:hidden;
    float:left;
    top:0;
    left:0;
    position:absolute;
    padding-top:1.5em;
}
.woocommerce .star-rating span:before {
    content:"\53\53\53\53\53";
    top:0;
    position:absolute;
    left:0
}

【问题讨论】:

    标签: php css wordpress woocommerce


    【解决方案1】:

    在你的 CSS 中使用它:

    .woocommerce .star-rating span {
       font-family:star;
    }
    

    【讨论】:

      【解决方案2】:

      就我而言,this answer 帮助了我。

      我在我的子主题的style.css 中添加了下一个代码:

      @font-face {
          font-family: 'star';
          src: url('../../plugins/woocommerce/assets/fonts/star.eot');
          src: url('../../plugins/woocommerce/assets/fonts/star.eot?#iefix') format('embedded-opentype'),
              url('../../plugins/woocommerce/assets/fonts/star.woff') format('woff'),
              url('../../plugins/woocommerce/assets/fonts/star.ttf') format('truetype'),
              url('../../plugins/woocommerce/assets/fonts/star.svg#star') format('svg');
          font-weight: normal;
          font-style: normal;
      }
      

      让您更好地了解正在发生的事情的完整路径:

      在此处添加代码: /wp-content/themes/gon-child/style.css

      字体原居地:/wp-content/plugins/woocommerce/assets/fonts/

      【讨论】:

        【解决方案3】:

        可能有一个 css 覆盖了项目的字体样式。 导致此问题的示例代码:

        *{
            font-family:'Raleway' !important;
        }
        

        单击浏览器的开发工具项,并查找其下方定义的样式可能会到达它,然后禁用它,您会看到星星会加载

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-04-27
          • 2020-07-12
          • 2017-08-25
          • 1970-01-01
          • 2016-08-17
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多