1. options.php 添加下面代码
将下面代码添加到主题的 options.php 文件中,至于添加位置一般在 return $options;
这句代码前面即可!
$options[] = array( 'name' => __('首页七栏广告', 'haoui'), 'id' => 'wzk_index_ad_open', 'std' => true, 'desc' => __('开启', 'haoui'), 'type' => 'checkbox'); $options[] = array( 'name' => '首页七栏广告', 'id' => 'wzk_index_ad', 'std' => '<section class="container"><div class="index-ad-text"> <div class="top-ad-box"> <div class="swiper-wrapper"> <div class="swiper-slide clearfix swiper-slide-active"> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/huobi.png" title="Huobi" alt="Huobi"> <h5>Huobi</h5> </div> <p class="desc">安全买币来火币</p> </a> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/bian.png" title="binance" alt="binance"> <h5>币安</h5> </div> <p class="desc">区块链数字资产交易平台</p> </a> <a href="https://wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/mayi.png" title="蚂蚁矿机" alt="蚂蚁矿机"> <h5>蚂蚁矿机</h5> </div> <p class="desc">T15为持续而生</p> </a> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/renbitlogo.png" title="RenrenBit" alt="RenrenBit"> <h5>RenrenBit</h5> </div> <p class="desc">让您轻松管理数字资产</p> </a> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/mxc.png" title="mxc" alt="mxc"> <h5>抹茶交易所</h5> </div> <p class="desc">新兴交易平台领军者</p> </a> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/gs.png" title="港盛科技" alt="港盛科技"> <h5>港盛科技</h5> </div> <p class="desc">BOMS+数字资产经纪商</p> </a> <a href="https://www.wenzika.com/" target="_blank" class="slide-item clearfix" rel="nofollow"> <div class="ad-info clearfix"> <img src="./wp-content/themes/dux/diy/img/npw.png" title="npw" alt="npw"> <h5>Npw</h5> </div> <p class="desc">永久薅羊毛手机钱包</p> </a> </div> </div> </div> </div></section>', 'type' => 'textarea');
添加完成以后,会在 “外观” ==> “DUX 主题设置” 中的最后一个菜单出现一个 “首页七栏广告” 模块,如下图所示:
2. 修改 index.php 文件
这一步是确定 “首页七栏广告推荐模块” 首页显示位置,将下面代码直接复制到 index.php 文件中:
您暂时无权查看此隐藏内容!
内容查看价格6元立即支付
欢迎访问文字咖(https://www.wenzika.com),本站资源多为网络收集,下载后请自行查毒! 任何单位或个人认为本网站内容可能涉嫌侵犯其合法权益,请及时书面反馈,并提供确切的个人身份证明、权属证明及详细情况证明,本网站在收到上述文件后将会尽快移除相关内容。本网站联系邮箱:962506815#qq.com 。如非特殊说明,本站所有资源解压密码均为:www.wenzika.com
密码不是ZYJ0116?
@莲花不妖 这篇文章属于特供,代码不分享!