wordpress知更鸟begin主题添加弹窗下载按钮

2024年03月22日15:47:28 发表评论 热度164 ℃

知更鸟主题有独立的下载页面,但是在主题设置中预留了下载弹窗广告的位置,但是我所使用的主题中没有弹窗广告的按钮,按照网上的教程今天为主题将这一功能给添加上。

最终效果

wordpress知更鸟begin主题添加弹窗下载按钮

第一步、增加按钮

首先在你的主题文件中找到 wp-content/themes/begin/inc/inc.php 文件

搜索<select id="sc_select">

在任意一行添加

  1. <option value="[*button*]按钮名称[*/button*]">弹窗按钮</option>

把代码中星号“*”去掉。

wordpress知更鸟begin主题添加弹窗下载按钮

保存,效果如下

wordpress知更鸟begin主题添加弹窗下载按钮

第二步、增加链接文本框

找到 wp-content/themes/begin/inc/meta-boxs.php 文件,搜索“$other_post_meta_boxes”,在后面适合的位置添加如下代码。

  1. "button1" => array(
  2.     "name" => "button1",
  3.     "std" => "",
  4.     "title" => "下载按钮名称( 弹窗中的按钮名称 )",
  5.     "type"=>"text"),
  6.     "url1" => array(
  7.     "name" => "url1",
  8.     "std" => "",
  9.     "title" => "下载链接( 弹窗中的下载链接 )",
  10.     "type"=>"text"),
  11. "no_sidebar" => array(
  12.     "name" => "no_sidebar",
  13.     "std" => "",
  14.     "title" => "隐藏侧边栏",
  15.     "type"=>"checkbox"),

wordpress知更鸟begin主题添加弹窗下载按钮

保存,然后在后台编辑文章时就可以看到我们添加的信息。

wordpress知更鸟begin主题添加弹窗下载按钮

 

 

瓜皮猪

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: