编辑主题文件:/wp-content/themes/ripro/parts/navbar-hover.php

如果有用子主题的就把代码放到子主题的目录

如:/wp-content/themes/子主题目录/parts/navbar-hover.php

如果用子主题没有这个【navbar-hover.php】文件就放到ripro的:/wp-content/themes/ripro/parts/navbar-hover.php

原本头部PHP代码:

复制
<?php global $current_user; $CaoUser = new CaoUser($current_user->ID); $site_money_ua = _cao('site_money_ua'); ?>

修改的代码请下载查看

复制
<?php global $current_user; $CaoUser = new CaoUser($current_user->ID); $site_money_ua = _cao('site_money_ua'); session_start(); if($_SESSION['cao_from_user_id']>=1 and $_SESSION['cao_from_user_id']!=$current_user->ID){ update_user_meta($current_user->ID, 'cao_ref_from',$_SESSION['cao_from_user_id']); } if (!$CaoUser->vip_status()) { update_user_meta($current_user->ID, 'cao_user_type','vip'); //增加会员一年时间 不懂这个strtotime("+1 month")的看这个网址https://blog.csdn.net/qq_25600055/article/details/79862421 $vidtime=date("Y-m-d",strtotime("+1 month")); update_user_meta($current_user->ID, 'cao_vip_end_time',$vidtime); echo "<script language=\"javascript\">alert('会员领取成功,".$CaoUser->vip_name()."到期时间:{$vidtime});</script>"; } ?>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。