RIPro-V2主题综合美化教程

RIPro-V2主题美化教程汇总,Rizhuti-V2主题、RiPro-V2主题美化几乎是通用的,因为主题模板的文件结构类似,也可参考《Rizhuti-V2主题综合美化教程》使用时注意文件路径即可!

美化教程:

提示:添加设置核心代码,可在子主题的functions.php文件添加,或者用二开文件里添加,如果使用的是二开文件,则需要在functions.php文件里引入,我们这里美化时采用的是父级主题的文件结构。

案例展示:

RiPro-V2主题添加案例展示模块
RiPro-V2主题添加案例展示模块

1.打开“rizhuti-v2-child/inc/options/widget-options.php”文件添加如下代码:

/**
 * 案例展示
 */
CSF::createWidget('ripro_v2_module_case', array(
    'title' => esc_html__('RI-首页模块 : 案例展示', 'ripro-v2'),
    'classname' => 'ripro_v2-widget-case',
    'description' => esc_html__('子主题主题 a 案例展示', 'ripro-v2'),
    'fields' => array(
        array(
            'id' => 'home_mode_case',
            'type' => 'fieldset',
            'title' => '',
            'fields' => array(
                array(
                    'id' => '_title',
                    'type' => 'text',
                    'title' => '标题',
                    'default' => '案例展示',
                ),
                array(
                    'id' => '_describe',
                    'type' => 'text',
                    'title' => '简介',
                    'default' => '优质客户网站案例展示',
                ),

                array(
                    'id' => 'casecms',
                    'type' => 'group',
                    'title' => '新建案例展示(至多4个)',
                    'max' => 4,
                    'fields' => array(
                        array(
                            'id' => 'case_title',
                            'type' => 'text',
                            'title' => '网站标题',
                            'default' => '360模板吧',
                        ),
                        array(
                            'id' => 'case_href',
                            'type' => 'text',
                            'title' => '网站地址',
                            'default' => 'https://www.360mb.net/',
                            'desc' => '记得填写完整地址哟!!!示例:https://www.360mb.net/',
                        ),
                        array(
                            'id' => 'case_describe',
                            'type' => 'textarea',
                            'title' => '网站描述',
                            'default' => '360模板吧是一个优质程序聚集地,不定期更新原创资360模板吧给大家,用心制作建站教程和源码评测,为更多的个人站长推荐有价值的好东西!',
                            'desc' => '这里填写该网站的描述',
                        ),
                        array(
                            'id'    => 'case_logo',
                            'type'  => 'upload',
                            'default' => trailingslashit(get_stylesheet_directory_uri()).'assets/images/case_logo.png',
                            'title' => '网站LOGO',
                        ),
                        array(
                            'id'    => 'case_bg',
                            'type'  => 'upload',
                            'default' => trailingslashit(get_stylesheet_directory_uri()).'assets/images/case_bg.png',
                            'title' => '背景图片',
                        ),
                    ),
                ),
            ),
        ),

    ),
));


if (!function_exists('ripro_v2_module_case')) {
    function ripro_v2_module_case($args, $instance)
    {
        if (!is_page_template_modular()) {
            return false;
        } //非模块页面不显示
        
        echo $args['before_widget'];
        //案例CSS
        //wp_enqueue_style('case_style', trailingslashit(get_stylesheet_directory_uri()) . 'assets/css/case.css?van_ver=' . VAN_VER);?>
    <section class="customer-show bgfff">
    <div class="home-title">
        <h3><?php echo $instance['home_mode_case']['_title'] ?></h3>
        <span><?php echo $instance['home_mode_case']['_describe'] ?></span>
    </div>
    <div class="container">
        <div class="customer-warp row">
            <?php if (!empty($instance['home_mode_case']['casecms'])) 
                foreach ($instance['home_mode_case']['casecms'] as $k => $item) {
            ?>
              <div class="col-12 col-lg-3">
                <div class="item">
                    <div class="item-header">
                        <div class="icon">
                            <img src="<?php echo $item['case_logo'] ?>" alt="<?php echo $item['case_title'] ?>" />
                        </div>
                        <div class="item-user">
                            <b><?php echo $item['case_title'] ?></b>
                            <span>
                            <?php 
                            echo  parse_url($item['case_href'])['host'];
                            ?></span>
                        </div>
                    </div>
                    <div class="item-desc"><?php echo $item['case_describe'] ?></div>
                        <div class="goto">
                            <a href="<?php echo $item['case_href'] ?>" target="_blank" rel="nofollow">前去围观</a>
                        </div>
                        <div class="item-bg">
                            <img src="<?php echo $item['case_bg'] ?>" />
                        </div>
                    </div>
                </div>
                <?php      
                }
                ?>
            </div>
        </div>
    </section>
    <?php

        echo @$args['after_widget'];

    }
}

2.然后直接在主题文件夹下的“child-style.css”文件里添加如下代码


@media (min-width: 800px){
.ripro_v2-widget-case .container{
    max-width:88%;
}
}
.customer-show {
    padding: 40px 0;
}
.customer-show .home-title {
    margin-bottom: 50px;
    text-align: center;
}
.customer-warp {
    margin-left: -35px!important;
    margin-right: -35px!important;
}
.customer-warp [class*="col-"] {
    padding-right: 35px;
    padding-left: 35px;
}
.customer-warp .item {
    position: relative;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.15);
    transition: all .3s;
    margin-bottom: 70px;
}
.customer-warp .item:hover {
    transform: translateY(-5px);
}
.customer-warp .item .item-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f6f6f6;
    padding-bottom: 30px;
}

.customer-warp .item .item-header .icon {
    width: 45px;
    height: 45px;
    margin-right:10px;
    position: relative;
    background: #f6f6f6;
    border-radius: 50%;
    overflow: hidden;
}
.customer-warp .item .item-header .icon img {
    max-width: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}
.customer-warp .item .item-header .item-user {
    flex: 1;
    overflow: hidden;
}
.customer-warp .item .item-header .item-user b {
    display: block;
    line-height: normal;
    font-size: 15px;
}
.customer-warp .item .item-header .item-user span {
    display: block;
    color: #999;
    font-size: 12px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.customer-warp .item .item-desc {
    color: #606266;
    font-size: 14px;
    height: 96px;
    line-height: 24px;
    margin: 30px 0 60px 0;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}
.customer-warp .item .goto {}
.customer-warp .item .goto a {
    display: inline-block;
    border: 2px solid #461cff;
    border-radius: 50px;
    font-size: 15px;
    padding: 5px 15px;
    color: #461cff;
    transition: all .3s;
}
.customer-warp .item:hover .goto a {
    background: #461cff;
    color: #fff;
}
.customer-warp .item .item-bg {
    position: absolute;
    bottom: 0;
    right: 0;
}
@media (max-width: 767px){
    .customer-show {
        padding: 20px;
    }
    .customer-warp .item {
        padding: 15px;
        margin-bottom: 20px;
    }
    .customer-show .home-title {
        margin-bottom: 20px;
    }
    .customer-show .home-title h3 {
        font-size: 24px;
    }
    .customer-warp {
        margin-left: -15px!important;
        margin-right: -15px!important;
    }
    .customer-warp [class*="col-"] {
        padding-right: 15px;
        padding-left: 15px;
    }
    .customer-warp .item .item-header {
        margin-bottom: 15px;
    }
    .customer-warp .item .item-desc {
        display: none;
    }
}
.home-title h3 {
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: normal;
}
.home-title span {
    color: #999;
    font-size: 13px;
}

合作伙伴:

RiPro-V2主题添加合作伙伴模块
RiPro-V2主题添加合作伙伴模块

1.打开“rizhuti-v2-child/inc/options/widget-options.php”文件添加如下代码:

/**
 * 合作伙伴
 */
CSF::createWidget('ripro_v2_module_partners', array(
    'title' => esc_html__('RI-首页模块 : 合作伙伴', 'ripro-v2'),
    'classname' => 'ripro_v2-widget-partners',
    'description' => esc_html__('VAN主题 a 合作伙伴', 'ripro-v2'),
    'fields' => array(
        array(
            'id' => 'home_mode_partners',
            'type' => 'fieldset',
            'title' => '',
            'fields' => array(
                array(
                    'id' => '_title',
                    'type' => 'text',
                    'title' => '标题',
                    'default' => '合作伙伴',
                ),
                array(
                    'id' => 'partnerscms',
                    'type' => 'group',
                    'title' => '新建案例展示(至多8个)',
                    'max' => 8,
                    'fields' => array(
                        array(
                            'id' => 'partners_title',
                            'type' => 'text',
                            'title' => '网站标题',
                            'default' => '360模板吧',
                        ),
                        array(
                            'id' => 'partners_href',
                            'type' => 'text',
                            'title' => '网站地址',
                            'default' => 'https://www.360mb.net/',
                            'desc' => '记得填写完整地址哟!!!示例:https://www.360mb.net/',
                        ),
                        array(
                            'id'    => 'partners_logo',
                            'type'  => 'upload',
                            'default' => trailingslashit(get_stylesheet_directory_uri()).'assets/images/partners_logo.png',
                            'title' => '网站LOGO',
                        ),
                    ),
                ),
            ),
        ),

    ),
));


if (!function_exists('ripro_v2_module_partners')) {
    function ripro_v2_module_partners($args, $instance)
    {
        if (!is_page_template_modular()) {
            return false;
        } //非模块页面不显示
        
        echo $args['before_widget'];
        //案例CSS
        wp_enqueue_style('partners_style', trailingslashit(get_stylesheet_directory_uri()) . 'assets/css/partners.css?van_ver=' . VAN_VER);?>
    <section class="tkm-cooper">
        <h3>
            <b><?php echo $instance['home_mode_partners']['_title'] ?></b>
        </h3>
        <div class="row">
            <?php if (!empty($instance['home_mode_partners']['partnerscms'])) 
                foreach ($instance['home_mode_partners']['partnerscms'] as $k => $item) {
            ?>
               <div class="col-6 col-lg-3">
                <div class="item">
                    <div class="item-logo">
                        <a href="<?php echo $item['partners_href'] ?>" ><img src="<?php echo $item['partners_logo'] ?>" alt="<?php echo $item['partners_title'] ?>" /></a>
                    </div>
                </div>
            </div>
            <?php      
            }
            ?>
           
        </div>
    </section>
    <?php

        echo @$args['after_widget'];

    }
}

2.然后直接在主题文件夹下的“child-style.css”文件里添加如下代码

 .tkm-cooper {}
    .tkm-cooper h3 {
        font-size: 24px;
        margin-bottom: 40px;
        text-align: center;
    }
    .tkm-cooper h3 b {
        display: inline-block;
        position: relative;
    }
    .tkm-cooper h3 b:after {
        content: "";
        width: 60px;
        height: 2px;
        position: absolute;
        background: linear-gradient(270deg,#61b1ff,#04f);
        bottom: -10px;
        left: 50%;
        margin-left: -30px;
    }
    .tkm-cooper .item {
        text-align: center;
        margin-bottom: 35px;
        height: 100px;
        background: #fff;
    }
    .tkm-cooper .item .item-logo {}
    .tkm-cooper .item .item-logo img {
        max-height: 100%;
    }
    .tkm-cooper .item:hover {
        box-shadow: 0 5px 15px 0 rgba(62,130,255,.13);
    }
@media (max-width: 767px){
    .tkm-cooper h3  {
        font-size: 18px;
    }
    .tkm-cooper .item {
        height: 60px;
        margin-bottom: 10px;
    }
}

点击爆炸效果:

RIPro-V2主题综合美化教程插图
鼠标点击爆炸效果

1.在主题文件夹下的“functions.php”文件里添加如下代码

VIP免费

已有0人支付

3.将此文件上传至“ripro-v2-child/assets/js/”文件夹下

4.在“ripro-v2-child/inc/options/admin-options.php”文件合适位置添加控制开关

		    array(
                    'id'      => 'click_boom',
                    'type'    => 'switcher',
                    'title'   => '是否启用点击爆炸效果',
                    'label'   => '启用后增加鼠标点击爆炸效果',
                    'default' => false,
                 ),

 

喜欢 2
1. 本站所有源码、模板、插件等其他资源,都不包含免费技术服务请大家谅解!
2. 本站提供的所有资源不免费提供个人需要的资源修改、美化、功能定制!
3. 如遇需要解压密码,则解压密码为"www.360mb.net"!
4. 由于源码属于可复制性产品,发货后禁止买家以各种理由退款!!
5. 本站提供资源如遇源码失效,功能异常等等可提供退款服务,可参考《退款规则》!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如用于商业或者非法用途,与本站无关,一切后果请用户自负!
360模板吧 » RIPro-V2主题综合美化教程

发表评论