<?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
$themename = get_option( 'stylesheet' );
$themename = preg_replace("/\W/", "_", strtolower($themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename;
update_option( 'optionsframework', $optionsframework_settings );
}
/**
* 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 'options_framework_theme'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
// Background Defaults
$background_defaults = array(
'color' => '',
'image' => '',
'repeat' => 'repeat',
'position' => 'top center',
'attachment'=>'scroll' );
// Typography Defaults
$typography_defaults = array(
'size' => '15px',
'face' => 'georgia',
'style' => 'bold',
'color' => '#bada55' );
// Typography Options
$typography_options = array(
'sizes' => array( '6','12','14','16','20' ),
'faces' => array( 'Helvetica Neue' => 'Helvetica Neue','Arial' => 'Arial' ),
'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ),
'color' => false
);
// If using image radio buttons, define a directory path
$imagepath = get_template_directory_uri() . '/images/';
$options = array();
$options[] = array(
'name' => __('Basic Settings', 'options_framework_theme'),
'type' => 'heading');
$options[] = array(
'name' => __('Theme Colour', 'options_framework_theme'),
'desc' => __('Select the base colour of the theme', 'options_framework_theme'),
'id' => 'colour',
'std' => 'green',
'type' => 'radio',
'options' => $test_array);
$options[] = array(
'name' => __('Logo', 'options_framework_theme'),
'desc' => __('Upload your logo image. Maximum height is 100 pixels.', 'options_framework_theme'),
'id' => 'logo_uploader',
'type' => 'upload');
$options[] = array(
'name' => "Banner Image",
'desc' => "Select the image used under the heading.",
'id' => "banner_image",
'std' => "horse",
'type' => "images",
'options' => array(
'horse' => $imagepath . 'banners\'1.jpg',
'forrest' => $imagepath . 'banners\'2.jpg'
));
return $options;
}