首先来到 /themes/ripro-v2/inc 目录下
将下面的文件覆盖至目录:inc,或打开 template-tags.php 文件替换代码
inc
大约在673行,添加这串代码:
$img .= '<span class="cd">折扣价 <strong>' .get_post_price($post_id). '</strong></span>';
然后继续往下滑动,大约在820行,替换下面这串代码:
echo '<span class="meta-shhop-icon"><i class="'.$this_icon.'"></i> '.($price_meta * 2).'</span>';
最后,将CSS代码添加至 app.css 文件,或者添加在后台自定义代码里,防止更新主题版本失效。
span.cd{
position: absolute;
font-size: 11px;
border-radius:4px 4px 4px 4px;
right: 0;
top: 0;
max-width: 100%;
background-color: #3c4c71;
color: #ffffff;
max-width: 100%;
margin-top: 9px;
margin-right: 5px;
display: inline-block;
height: 28px;
line-height: 28px;
border-radius: 5px;
padding: 0 5px;
}
span.cd strong{
font-size: 14px;
font-weight: bold;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。