按钮前面加图标,图标使用fontawesome图标,包括立即购买按钮图标,自定义按钮图标,开通VIP按钮图标。

免登陆购买按钮

if ($the_user_type == 'nov' && $the_post_price == -1) {
 echo '<button type="button" class="btn btn-block btn-danger mb-3" disabled><i class="fa fa-shopping-bag mr-1"></i>' . esc_html__('VIP专享资源', 'ripro-v2') . '</button>';
} elseif (empty($user_id) && !is_site_nologin_pay()) {
echo '<button type="button" class="btn btn-block btn-primary mb-3 login-btn"><i class="fa fa-shopping-bag mr-1"></i>' . esc_html__('登录后购买', 'ripro-v2') . '</button>';
} else {
 echo '<button type="button" class="btn btn-block btn-primary mb-3 click-pay-post" data-postid="' . $post_id . '" data-nonce="' . $click_nonce . '" data-price="' . $the_post_price . '"><i class="fa fa-shopping-bag mr-1"></i>' . esc_html__('立即购买', 'ripro-v2') . '</button>';
}

首页会员开通模块

你的域名/wp-content/themes/ripro-v2/inc/options/widget-options.php,搜索“前往开通

<a rel="nofollow noopener noreferrer" href="<?php%20echo%20get_user_page_url('vip');?>" class="btn btn-sm btn-success mt-2<?php echo $classes;?>"><i class="fa fa-user mr-1"></i><?php echo esc_html__('前往开通','ripro-v2');?></a>

 VIP单页前往开通

<?php if ($current_user->ID > 0) {
echo '<a class="btn btn-warning" href="'.get_user_page_url('vip').'"><i class="fa fa-user mr-1"></i>前往个人中心立即加入</a>';
}else{
echo '<a class="btn btn-warning login-btn" href="#"><i class="fa fa-user mr-1"></i>登录后操作</a>';
}?>

立即下载按钮及提取码

foreach ($arr as $key => $item) {
        $down_ids  = urlencode(base64_encode($post_ID . '-' . $key . '-' . $nonce));
        $down_link = get_goto_url('down', $down_ids);
        echo '<div class="btn-group btn-block mt-2" role="group">';
        echo '<a target="_blank" href="'%20.%20$down_link%20.%20'" class="btn btn-dark"><i class="fa fa-cloud-download"></i> ' . $item['name'] . '</a>';
        if (!empty($item['pwd'])) {
            echo '<button type="button" class="go-copy btn btn-sm btn-dark" data-toggle="tooltip" data-placement="top" title="' . esc_html__
('点击复制提取码', 'ripro-v2') . '" data-clipboard-text="' . $item['pwd'] . '"><span><i class="fa fa-paper-plane mr-1"></i>' . esc_html__
('提取码:', 'ripro-v2') . '</span>' . $item['pwd'] . '</button>';
        }
        echo '</div>';
    }

 

发表评论

后才能评论