File: /www/wwwroot/doba123.com/wp-content/themes/duba2/options.php
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
*/
function optionsframework_option_name() {
// Change this to use your theme slug
return 'options-framework-theme';
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the 'id' fields, make sure to use all lowercase and no spaces.
*
* If you are making your theme translatable, you should replace 'theme-textdomain'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
// 将所有分类(categories)加入数组
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
$options = array();
$options[] = array(
'name' => __('全站设置', 'GJ') ,
'type' => 'heading'
);
$options[] = array(
'name' => __('公司名称', 'GJ') ,
'id' => 'company_name',
'type' => 'text'
);
$options[] = array(
'name' => __('电脑端LOGO设置', 'GJ') ,
'desc' => __('电脑端LOGO,高度不超过60px', 'GJ') ,
'id' => 'pc_logo',
'type' => 'upload'
);
$options[] = array(
'name' => __('手机端LOGO设置', 'GJ') ,
'desc' => __('手机端LOGO,高度不超过40px', 'GJ') ,
'id' => 'm_logo',
'type' => 'upload'
);
$options[] = array(
'name' => __('座机号码', 'GJ') ,
'id' => 'zuoji_tel',
'type' => 'text'
);
$options[] = array(
'name' => __('400号码', 'GJ') ,
'id' => '400_tel',
'type' => 'text'
);
$options[] = array(
'name' => __('手机号码', 'GJ') ,
'id' => 'shouji_tel',
'type' => 'text'
);
$options[] = array(
'name' => __('邮箱', 'GJ') ,
'id' => 'email',
'type' => 'text'
);
$options[] = array(
'name' => __('邮编', 'GJ') ,
'id' => 'cope',
'type' => 'text'
);
$options[] = array(
'name' => __('公司地址', 'GJ') ,
'id' => 'address',
'type' => 'text'
);
$options[] = array(
'name' => __('QQ', 'GJ') ,
'id' => 'contact_qq',
'type' => 'text'
);
$options[] = array(
'name' => __('QQ咨询链接', 'GJ') ,
'id' => 'qqzx_link',
'type' => 'text'
);
$options[] = array(
'name' => __('百度商桥咨询链接', 'GJ') ,
'id' => 'bdzx_link',
'type' => 'text'
);
$options[] = array(
'name' => __('ICP备案号', 'GJ') ,
'id' => 'icp_number',
'type' => 'text'
);
$options[] = array(
'name' => __('ICP备案号链接', 'GJ') ,
'id' => 'icp_n_link',
'type' => 'text'
);
$options[] = array(
'name' => __('公安备案号图标', 'GJ') ,
'id' => 'safe_n_icon',
'type' => 'upload'
);
$options[] = array(
'name' => __('公安备案号', 'GJ') ,
'id' => 'safe_number',
'type' => 'text'
);
$options[] = array(
'name' => __('公安备案号链接', 'GJ') ,
'id' => 'safe_n_link',
'type' => 'text'
);
$options[] = array(
'name' => __('微信二维码', 'GJ') ,
'id' => 'weixin_erweima',
'type' => 'upload'
);
$options[] = array(
'name' => __('电子亮照', 'GJ') ,
'id' => 'dz_zhizhao',
'type' => 'upload'
);
$options[] = array(
'name' => __('电子亮照链接', 'GJ') ,
'id' => 'dz_zz_link',
'type' => 'text'
);
$options[] = array(
'name' => __('网站地图链接', 'GJ') ,
'id' => 'sitemap_link',
'type' => 'text'
);
/*******分隔*******/
$options[] = array(
'name' => __('首页轮播图/广告图', 'GJ') ,
'type' => 'heading'
);
$options[] = array(
'name' => __('以下图片宽度应为1920px', 'GJ') ,
);
for ($i = 1; $i <= 3; $i++) {
$options[] = array(
'name' => __('轮播图' . $i, 'GJ') ,
'id' => 'banner_src' . $i,
'std' => '',
'type' => 'upload'
);
$options[] = array(
'name' => __('手机端轮播图' . $i, 'GJ') ,
'id' => 'banner_m_src' . $i,
'std' => '',
'type' => 'upload'
);
$options[] = array(
'name' => __('轮播图超链接' . $i, 'GJ') ,
'id' => 'banner_link' . $i,
'std' => '',
'type' => 'text'
);
}
/*******分隔*******/
$options[] = array(
'name' => __('内页横幅(Banner)', 'GJ') ,
'type' => 'heading'
);
$options[] = array(
'name' => __('以下图片宽度应为1920px', 'GJ') ,
);
$options[] = array(
'id' => 'products',
'desc' => __('产品中心', 'GJ') ,
'type' => 'upload'
);
$options[] = array(
'id' => 'banner_news',
'desc' => __('新闻资讯', 'GJ') ,
'type' => 'upload'
);
$options[] = array(
'id' => 'banner_about',
'desc' => __('关于我们', 'GJ') ,
'type' => 'upload'
);
/*******分隔*******/
$options[] = array(
'name' => __('统计代码', 'GJ') ,
'type' => 'heading'
);
$options[] = array(
'name' => __('网站统计代码', 'Solome') ,
'desc' => __('位于底部,用于添加第三方流量数据统计代码,如:Google analytics、百度统计、CNZZ、51la,国内站点推荐使用百度统计,国外站点推荐使用Google analytics', 'Solome') ,
'id' => 'trackcode',
'std' => '',
'type' => 'textarea'
);
/*******分隔*******/
$options[] = array(
'name' => __('客服系统代码', 'GJ') ,
'type' => 'heading'
);
$options[] = array(
'name' => __('百度商桥代码', 'Solome') ,
'desc' => __('百度商桥代码直接粘贴在左方区域', 'Solome') ,
'id' => 'shangqiaocode',
'std' => '',
'type' => 'textarea'
);
$options[] = array(
'name' => __('其它客服系统代码', 'Solome') ,
'desc' => __('如:商务通,53客服等', 'Solome') ,
'id' => 'qitacode',
'std' => '',
'type' => 'textarea'
);
return $options;
}