ripro主题美化代码设置与模块美化教程

ripro主题美化添加VIP引导页,首页幻灯片美化,添加站点统计模块,默认修改首页五列布局

这些源码是网友细分出来的,也就是那些整体美化包中的所用的代码,本站暂时未测试,如果正是你需要的可以复制到本地自己测试。当然有的代码是需要自己找到关键点加到自己当前模板版本中使用,并不是说所有代码你复制到里面就一定能使用.

—–VIP引导页—–

第一步:ripro -> parts 目录下navbar.php,在“
<div class=””actions””>

”和“<!–?php if (is_site_shop_open()) : ?–>”之间添加如下代码
<div class=”menu-head_you-container” title=”加入VIP,免费下载全站素材”>
<ul id=”menu-head_you” class=”menu”>
<li id=”menu-item-967″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-967″><a href=”vip”><i class=”fa fa-diamond”></i> 开通会员</a></li>
</ul>
</div>
第二步:ripro -&gt; pages目录下添加 vip.php,录入如下代码并保存
<!–?php /** * Template name: 会员介绍 * Description: A VIP introduction page */ $vip_site = _cao( ‘homevip_field’); $vip_mone = _cao( ‘homevip_montext’); $homevip_group = _cao(‘homevip_group’); get_header(); ?–>
<div class=”vip-banner”><img src=”&lt;?php echo esc_url( $vip_site[‘homevip_topimg’] ); ?&gt;” />
<div class=”vipbj”>
<h2></h2>
&nbsp;

<!–?php if ($vip_site[‘homevip_top_title’]) : ?–>
<!–?php echo $vip_site[‘homevip_top_text’]; ?–>
<!–?php endif; ?–>

</div>
</div>
<div class=”module-line”>
<!–?php echo _cao(‘homevip_numtext’);?–></div>
<div class=”row vip-slogan”><!–?php if (!empty($homevip_group)) { foreach ($homevip_group as $key =&gt; $link) {&lt;br ?–> echo ‘
<div class=”col-xs-12 col-sm-6 col-md-4 vip-slogan-box”>

&nbsp;
<div class=”vip-slogan-text”>

‘.$link[‘_text1′].’

‘.$link[‘_text2′].’

</div>
</div>
‘;
}
}?&gt;

</div>
<div class=”container”><article id=”post-&lt;?php the_ID(); ?&gt;” class=”single-content”>&gt;
<div class=”module-line”>
<!–?php echo $vip_mone[‘_title1’]; ?–>
<div class=”vip-desc”></div>
</div>
<div class=”container”>
<div class=”vip-row vip-block-wrapper” style=”padding-bottom: 0; padding-top: 30px; margin-bottom: 0;”><!–?php $vip_pay_setting = _cao(‘vip-pay-setting’); foreach ($vip_pay_setting as $key =&gt; $item) {&lt;br ?–> echo ‘
<div class=”vip-block-item”>
<div class=”home-vipbox”>
<div class=”icon”>’;
echo ‘<img src=”‘.$item[‘vipico’].'” /></div>
‘;
if ($item[‘daynum’] == 7) {
echo ‘
<h3 class=”content0-title”>包周会员</h3>
‘;
echo ‘
<p class=”vip-home-price”>’.$item[‘price’].'<i>’._cao(‘site_money_ua’).'</i></p>
‘;
echo ‘

周费VIP ‘.$item[‘daynum’].’天 福利

‘;
}elseif ($item[‘daynum’] == 30 || $item[‘daynum’] == 31){
echo ‘
<h3 class=”content0-title”>包月会员</h3>
‘;
echo ‘
<p class=”vip-home-price”>’.$item[‘price’].'<i>’._cao(‘site_money_ua’).'</i></p>
‘;
echo ‘

月费VIP ‘.$item[‘daynum’].’天 福利

‘;
}elseif ($item[‘daynum’] == 365){
echo ‘
<h3 class=”content0-title”>包年会员</h3>
‘;
echo ‘
<p class=”vip-home-price”>’.$item[‘price’].'<i>’._cao(‘site_money_ua’).'</i></p>
‘;
echo ‘

年费VIP ‘.$item[‘daynum’].’天 福利

‘;
}elseif ($item[‘daynum’] == 9999){
echo ‘
<h3 class=”content0-title”>终身会员</h3>
‘;
echo ‘
<p class=”vip-home-price”>’.$item[‘price’].'<i>’._cao(‘site_money_ua’).'</i></p>
‘;
echo ‘

终身VIP 终身 福利

‘;
}else{
echo ‘
<h3 class=”content0-title”>请后台设置</h3>
‘;
}
echo ‘

‘.$item[‘description1′].’

‘;
if ($item[‘daynum’] == 7 || $item[‘daynum’] == 30 || $item[‘daynum’] == 31 || $item[‘daynum’] == 365 ){
echo ‘

每天可下载’._cao(‘vip_down_num’).’个VIP资源

‘;
}elseif ($item[‘daynum’] == 9999){
echo ‘

每天可下载’._cao(‘boosvip_down_num’).’个VIP资源

‘;
}
echo ‘

‘.$item[‘description2′].’

‘;
echo ‘
<p class=”vip-bt”>开通</p>
‘;
echo ‘

</div>
</div>
‘;
} ?&gt;

</div>
</div>
</article></div>
<div style=”clear: both;”></div>
<style type=”text/css”>
.site-content{ padding:0px;}<br />
.term-bar{ display:none;}<br />
</style><!–?php get_footer(); ?–>
第三步:ripro -&gt; inc -&gt; codestar-framework -&gt; options 目录下打开 options.theme.php,搜索“// 商城-佣金设置并跳转到该位置”,在该备注上方“));”后添加如下代码
//
// Field: VIP页设置
//
CSF::createSection($prefix, array(
‘parent’ =&gt; ‘shop_fields’,
‘title’ =&gt; ‘VIP页设置’,
‘icon’ =&gt; ‘fa fa-circle’,
‘fields’ =&gt; array(
array(
‘id’ =&gt; ‘homevip_field’,
‘type’ =&gt; ‘fieldset’,
‘title’ =&gt; ‘头部大图相关设置’,
‘fields’ =&gt; array(
array(
‘id’ =&gt; ‘homevip_topimg’,
‘type’ =&gt; ‘upload’,
‘title’ =&gt; ‘VIP引导页头部大图’,
‘dsec’ =&gt; ‘上传一张显示在VIP引导页的大图’,
‘default’ =&gt; get_stylesheet_directory_uri() . ‘/assets/images/comvip-banner.png’,
),
array(
‘id’ =&gt; ‘homevip_top_title’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘头部大图文字’,
‘default’ =&gt; ‘开通VIP独享海量下载特权’,
),
array(
‘id’ =&gt; ‘homevip_top_description’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘头部大图描述’,
‘default’ =&gt; ‘现在努力只为 不再仰望大神的后背!’,
),
array(
‘id’ =&gt; ‘homevip_top_switcher’,
‘type’ =&gt; ‘switcher’,
‘title’ =&gt; ‘头部大图按钮开关’,
‘default’ =&gt; true,
),
array(
‘id’ =&gt; ‘homevip_top_text’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘按钮文字’,
‘default’ =&gt; ‘开通会员’,
‘dependency’ =&gt; array(‘homevip_top_switcher’, ‘==’, ‘true’),
),
),
),
array(
‘type’ =&gt; ‘notice’,
‘style’ =&gt; ‘success’,
‘content’ =&gt; ‘注意,这里添加特权说明时,请添加3或3的倍数个,不然不美观!!!特权图标示例 <span style=”color: red;”>fa fa-vimeo-square</span> <a target=”_blank” rel=”noopener noreferrer”>图标获取地址:http://fontawesome.dashgame.com/</a>’,
‘dependency’ =&gt; array(‘is_show_homevip’, ‘==’, ‘true’),
),
array(
‘id’ =&gt; ‘homevip_numtext’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘VIP特权模块标题’,
‘default’ =&gt; ‘会员尊享6项特权’,
),
array(
‘id’ =&gt; ‘homevip_group’,
‘type’ =&gt; ‘group’,
‘title’ =&gt; ‘VIP特权说明’,
‘label’ =&gt; ‘请添加3或3的倍数个,不然不美观!!!’,
‘max’ =&gt; ‘6’,
‘fields’ =&gt; array(
array(
‘id’ =&gt; ‘_ico’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘特权图标’,
‘default’=&gt;’fa fa-vimeo-square’,
),
array(
‘id’ =&gt; ‘_text1’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘特权说明-1(大标题)’,
‘default’=&gt;’1000+资源,无限量下载’,
),
array(
‘id’ =&gt; ‘_text2’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘特权说明-2’,
‘default’=&gt;’真正的海量,无套路,诚意满满’,
),
),
‘default’ =&gt; array(
array(
‘_ico’ =&gt; ‘fa fa-vimeo-square’,
‘_text1’=&gt; ‘1000+资源,无限量下载’,
‘_text2’=&gt; ‘真正的海量,无套路,诚意满满’,
),
),
),
array(
‘id’ =&gt; ‘homevip_montext’,
‘type’ =&gt; ‘fieldset’,
‘title’ =&gt; ‘VIP资费设置’,
‘fields’ =&gt; array(
array(
‘id’ =&gt; ‘_title1’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘标题-1’,
‘default’=&gt;’VIP会员资费介绍’,
),
array(
‘id’ =&gt; ‘_title2’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘标题-2’,
‘attributes’ =&gt; array(
‘style’ =&gt; ‘width: 100%;’,
),
‘default’=&gt;’在这里,会员每平均10个用户开通会员, 下载资源 100+份~’,
),
),
),
),
));
第四步:主题目录打开 functions.php ,搜索“pages/tags.php”并跳转到该处,换一行添加
‘pages/vip.php’ =&gt; array(‘会员介绍’, ‘vip’),
注:第四步作用是将vip引导页设为默认添加页面,这一步不强求大家添加,视个人喜好而定

第一步:ripro -&gt; inc -&gt; codestar-framework -&gt; options 目录下打开 options.theme.php,搜索“‘lastpost’ =&gt; ‘最新文章展示’”并跳转到该处,换一行添加

‘census’ =&gt; ‘统计模块’

第二步:ripro -&gt; parts -&gt; home-mode目录下新建“census.php”,并添加如下代码
<!–?php $mode_census = _cao(‘mode_census’); $count_posts = wp_count_posts(); $users = $wpdb-&gt;get_var(“SELECT COUNT(ID) FROM $wpdb-&gt;users”);&lt;br ?–> ob_start(); ?&gt;
<div class=”section text-center pb-0″ style=”padding-top: 20px; height: 75px;”>
<div class=”container”>
<div class=”alert alert-modern alert-dark”>
<div class=”alert-content”><span class=”type_icont_2″><i class=”fa fa-bell-o”></i> 博主统计 </span>
资源总数:<!–?php echo $published_posts = $count_posts-&gt;publish;?–>个 ๑ 注册用户:<!–?php echo $users; ?–>位 ๑ 本周更新:<!–?php echo get_week_post_count(); ?–>篇 ๑ 今日更新:<!–?php echo WeeklyUpdate();?–>篇

&nbsp;

</div>
</div>
</div>
</div>
第三步:主题目录打开 functions.php ,在最后一行后面添加
// 每周更新
function get_week_post_count(){
$date_query = array(
array(
‘after’=&gt;’1 week ago’
)
);$args = array(
‘post_type’ =&gt; ‘post’,
‘post_status’=&gt;’publish’,
‘date_query’ =&gt; $date_query,
‘no_found_rows’ =&gt; true,
‘suppress_filters’ =&gt; true,
‘fields’=&gt;’ids’,
‘posts_per_page’=&gt;-1
);
$query = new WP_Query( $args );
return $query-&gt;post_count;
}
// 每周日新
function WeeklyUpdate() {
$today = getdate();
$query = new WP_Query( ‘year=’ . $today[“year”] . ‘&amp;monthnum=’ . $today[“mon”] . ‘&amp;day=’ . $today[“mday”]);
$postsNumber = $query-&gt;found_posts;
echo $postsNumber;
}

第一步:ripro -&gt; parts -&gt; home-mode -&gt; slider.php,第五行到第九行替换为如下代码
<div class=”section”>
<div class=”container”>
<div class=”module slider big owl nav-white &lt;?php echo esc_attr( $mode_slider[‘autoplay’] ? ‘ autoplay’ : ” ); ?&gt;”>
<!–?php foreach ($mode_slider[‘diy_data’] as $key =&gt; $item) {?–><article class=”post lazyload visible” data-bg=”&lt;?php echo esc_url( $item[‘_img’] );?&gt;”>
<div class=”container”><a class=”u-permalink” target=”_blank” rel=”noopener noreferrer”>”&gt;</a></div>
</article>&nbsp;

</div>
</div>
</div>
请注意:VIP页面有额外功能没有上传代码,请大家及时改正(除教程发布的代码外,需额外添加其他设置选项)
ripro -&gt; inc -&gt; codestar-framework -&gt; options 目录下打开 options.theme.php,搜索“开通套餐设置”,定位到该结果出,修改该处设置
array(
‘id’ =&gt; ‘vip-pay-setting’,
‘type’ =&gt; ‘repeater’,
‘title’ =&gt; ‘开通套餐设置(’ . _cao(‘site_vip_name’) . ‘)’,
‘max’ =&gt; ‘3’,
‘fields’ =&gt; array(
array(
‘id’ =&gt; ‘vipico’,
‘type’ =&gt; ‘upload’,
‘title’ =&gt; ‘VIP图标’,
‘desc’ =&gt; ‘上传一张png图片作为VIP展示图’,
‘default’ =&gt; get_stylesheet_directory_uri() . ‘/assets/images/vip.png’,
),
array(
‘id’ =&gt; ‘daynum’,
‘type’ =&gt; ‘text’,
‘default’ =&gt; ’30’,
‘desc’ =&gt; ‘比如你想设置一个套餐是月费,则填写30,如果要设置终身会员套餐,填写:9999’,
‘title’ =&gt; ‘开通天数’,
),
array(
‘id’ =&gt; ‘price’,
‘type’ =&gt; ‘text’,
‘default’ =&gt; ’20’,
‘desc’ =&gt; ‘此套餐所需的’ . _cao(‘site_money_ua’) . ‘数量,例: 会员一天需要1,设置一个月费则是30,如果填写为15,则相当于在打折’,
‘title’ =&gt; ‘套餐价格’,
),
array(
‘id’ =&gt; ‘color’,
‘type’ =&gt; ‘color’,
‘default’ =&gt; ‘#ff6a6d’,
‘title’ =&gt; ‘背景颜色’,
),
array(
‘id’ =&gt; ‘description1’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘VIP特权说明-1’,
‘default’ =&gt; ‘享受下载折扣及免费下载相应资源’,
),
array(
‘id’ =&gt; ‘description2’,
‘type’ =&gt; ‘text’,
‘title’ =&gt; ‘VIP特权说明-2’,
‘default’ =&gt; ‘急速网盘无广告’,
),
),
‘default’ =&gt; array(
array(
‘vipico’=&gt; get_stylesheet_directory_uri() . ‘/assets/images/vip.png’,
‘daynum’ =&gt; ’30’,
‘price’ =&gt; ’10’,
‘color’ =&gt; ‘#ff6a6d’,
‘description1’=&gt; ‘享受下载折扣及免费下载相应资源’,
‘description2’=&gt; ‘急速网盘无广告’,
),
),
),
VIP引导页设置项缺失,现已补上缺失代码

</div>

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!443252835@qq.com
2. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!
3. 如果你也有好源码或者教程,可以到直接会员中心发布,分享有会员购买会会有收入!可提现!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!如果连基本小程序安装不会的先买站内的小程序安装教程看完再买源码!
5. 如有链接无法下载、失效或广告,请联系管理员QQ处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站不保证所提供下载的资源的准确性、安全性和完整性,源码仅供下载学习之用!
8. 如用于商业或者非法用途,与本站无关,一切后果请用户自负!
9. 如遇到加密压缩包,默认解压密码为"dghoyo.com",如遇到无法解压的请联系管理员!

动能源码站由众多网友分享:php源码,商业源码,wp主题,人人商城,破解模块,商业插件,微信小程序,小程序源码,微信小程序源码,织梦模板,微信营销源码,破解软件的工具等资源!
动能源码 » ripro主题美化代码设置与模块美化教程

发表评论

提供最优质的电商培训资源集合

立即查看 了解详情