کدهای مربوط به option.php
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*
*/
function optionsframework_option_name() {
// This gets the theme name from the stylesheet (lowercase and without spaces)
$themename = get_theme_data(STYLESHEETPATH . '/style.css');
$themename = $themename['Name'];
$themename = preg_replace("/\W/", "", strtolower($themename) );
$optionsframework_settings = get_option('optionsframework');
$optionsframework_settings['id'] = $themename;
update_option('optionsframework', $optionsframework_settings);
// echo $themename;
}
/**
* 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.
*
*/
function optionsframework_options() {
$yesno = array('no' => 'No', 'yes' =>'Yes' );
$float = array('left' => 'left', 'right' =>'right');
// Test data
$test_array = array("one" => "One","two" => "Two","three" => "Three","four" => "Four","five" => "Five");
// Multicheck Array
$multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle");
// Multicheck Defaults
$multicheck_defaults = array("one" => "true","five" => "true");
// Background Defaults
$border = array('color' => '', 'style' => 'solid', 'position' => 'border', 'size'=>'' );
$shadow = array('color' => '', 'size'=>'' );
$position = array('top' => '', 'right' =>'', 'bottom' =>'', 'left' =>'' );
$bodybg = array('repeat' => 'repeat-x');
$bodytypo = array('size' => '12px', 'face' =>'tahoma', 'style' => 'normal' );
$slideTypo = array('size' => '12px', 'face' =>'tahoma', 'style' => 'normal' );
$navTypo = array('size' => '16px', 'face' =>'Hacen Saudi Arabia');
$postTitleTypo = array('size' => '18px', 'face' =>'mohammad_bold' );
$postContentTypo = array('size' => '13px', 'face' =>'tahoma', 'style' => 'normal' );
$sideTitleTypo = array('size' => '14px', 'face' =>'Hacen Saudi Arabia');
$iread_title = array('size' => '24px', 'face' =>'tnaskh');
//H typo
$h1 = array('size' => '36px', 'face' =>'arial' );
$h2 = array('size' => '30px', 'face' =>'arial' );
$h3 = array('size' => '24px', 'face' =>'arial' );
$h4 = array('size' => '18px', 'face' =>'arial' );
$h5 = array('size' => '14px', 'face' =>'arial' );
$h6 = array('size' => '12px', 'face' =>'arial' );
//position
$headlogopos = array('top' => '40', 'left' => '10');
//nivo slider
$nivo_effects = array('random' => 'random', 'sliceDown' => 'sliceDown', 'sliceDownLeft' => 'sliceDownLeft', 'sliceUp' => 'sliceUp', 'sliceUpLeft' => 'sliceUpLeft','sliceUpDown' => 'sliceUpDown', 'sliceUpDownLeft' => 'sliceUpDownLeft', 'fold' => 'fold', 'fade' => 'fade', 'random' => 'random',
'slideInRight' => 'slideInRight', 'slideInLeft' => 'slideInLeft', 'boxRandom' => 'boxRandom', 'boxRain' => 'boxRain',
'boxRainReverse' => 'boxRainReverse', 'boxRainGrow' => 'boxRainGrow', 'boxRainGrowReverse' => 'boxRainGrowReverse', );
//cycle Slider
$cycle_effects = array('blindX' => 'blindX', 'blindY' => 'blindY', 'blindZ' => 'blindZ', 'cover' => 'cover', 'curtainX' => 'curtainX','curtainY' => 'curtainY', 'fade' => 'fade', 'fadeZoom' => 'fadeZoom', 'growX' => 'growX', 'growY' => 'growY',
'none' => 'none', 'scrollUp' => 'scrollUp', 'scrollDown' => 'scrollDown', 'scrollLeft' => 'scrollLeft',
'scrollRight' => 'scrollRight', 'scrollHorz' => 'scrollHorz', 'scrollVert' => 'scrollVert',
'shuffle' => 'shuffle', 'slideX' => 'slideX', 'slideY' => 'slideY', 'toss' => 'toss',
'turnUp' => 'turnUp', 'turnDown' => 'turnDown', 'turnLeft' => 'turnLeft', 'turnRight' => 'turnRight', 'uncover' => 'uncover', 'wipe' => 'wipe', 'zoom' => 'zoom');
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories('hide_empty=0');
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages['false'] = 'صفحه را انتخاب کنید : ';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
//porduct category
$serie_categories = array();
$serie_categories_obj = get_categories('taxonomy=serie_cat');
foreach ($serie_categories_obj as $scategory) {
$serie_categories[$scategory->cat_ID] = $scategory->cat_name;
}
// If using image radio buttons, define a directory path
$imagepath = get_bloginfo('stylesheet_directory') . '/Lioit/admin/images/';
$options = array();
// General Setting
$options[] = array( "name" => __('تنظیمات عمومی', 'theme'),
"type" => "heading",
"slug" => "general"
);
$options[] = array( "name" => __('ویژگی ها و تنظیمات', 'theme'),
"type" => "info"
);
$options[] = array( "name" => __(' آیکون سایت', 'theme'),
"desc" => __('آدرس آیکون'),
"id" => "custom_favicon",
"type" => "upload",
);
$options[] = array( "name" => __('انتخاب دسته نیوز تیکر', 'theme'),
"id" => "ticker_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته اسلایدر', 'theme'),
"id" => "slideshow_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد اسلایدها', 'theme'),
"id" => "slideshow_num",
"std" => '3',
"type" => "text"
);
$options[] = array( "name" => __('انتخاب دسته ویژه ها', 'theme'),
"id" => "spical_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته 5 خبر', 'theme'),
"id" => "five_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته اخبار اصلی', 'theme'),
"id" => "main_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد اخبار اصلی', 'theme'),
"desc" => __(''),
"id" => "main_num",
"std" => '15',
"type" => "text",
);
// End General
// Social
$options[] = array( "name" => __('سایدبار سمت راست', 'theme'),
"type" => "heading",
"slug" => "social",
);
$options[] = array( "name" => __('تنظیمت سایدبار', 'theme'),
"type" => "info"
);
$options[] = array( "name" => __('انتخاب دسته اخبار ایران و جهان', 'theme'),
"id" => "khabar_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد اخبار ایران و جهان', 'theme'),
"desc" => __(''),
"id" => "khabar_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('انتخاب دسته اخبار خوزستان ', 'theme'),
"id" => "khou_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد اخبار خوزستان ', 'theme'),
"desc" => __(''),
"id" => "khou_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('انتخاب دسته اخبار شهرستان', 'theme'),
"id" => "shahr_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد اخبار شهرستان ', 'theme'),
"desc" => __(''),
"id" => "shahr_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('تعداد مطالب اخبار خوزستان و شهرستان', 'theme'),
"desc" => __(''),
"id" => "side_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('انتخاب دسته یاداشت', 'theme'),
"id" => "note_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد مطالب بخش یادداشت', 'theme'),
"desc" => __(''),
"id" => "note_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('تنظیمات بخش عکس صوت فیلم', 'theme'),
"type" => "info"
);
$options[] = array( "name" => __('انتخاب دسته عکس', 'theme'),
"id" => "pic_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته فیلم', 'theme'),
"id" => "vdo_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته صوت', 'theme'),
"id" => "aud_cat",
"type" => "select",
"options" => $options_categories
);
// End Social
// Sliders Config
$options[] = array( "name" => __('سایدبار سمت چپ', 'theme'),
"type" => "heading",
"slug" => "sliders"
);
$options[] = array( "name" => __('تنظیمات سایدبار چپ', 'theme'),
"type" => "info"
);
$options[] = array( "name" => __('انتخاب دسته آخرین مطالب', 'theme'),
"id" => "lastp_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد آخرین مطالب سمت چپ', 'theme'),
"desc" => __(''),
"id" => "last_num",
"std" => '15',
"type" => "text",
);
$options[] = array( "name" => __('انتخاب دسته کاریکاتور', 'theme'),
"id" => "carton_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته گفتگو', 'theme'),
"id" => "cnv_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('تعداد مطالب بخش گفتگو', 'theme'),
"desc" => __(''),
"id" => "cnv_num",
"std" => '3',
"type" => "text",
);
// Sliders Config
// ads
$options[] = array( "name" => __('تنظیمات فوتر', 'theme'),
"type" => "heading",
"slug" => "ads"
);
$options[] = array( "name" => __('تبلیغات 3 بخش پایین صفحه', 'theme'),
"type" => "info",
);
$options[] = array( "name" => __('انتخاب دسته دفاع مقدس', 'theme'),
"id" => "dfm_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته سبک زندگی', 'theme'),
"id" => "szg_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته ورزشی', 'theme'),
"id" => "vbg_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته وبلاگستان', 'theme'),
"id" => "weblog_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب دسته معرفی شهرستان', 'theme'),
"id" => "shahr_cat",
"type" => "select",
"options" => $options_categories
);
$options[] = array( "name" => __('انتخاب خواندنی ها', 'theme'),
"id" => "khandaniha_cat",
"type" => "select",
"options" => $options_categories
);
//ads
return $options;
}