optionsframework_options

Defines an array of options that will be used to generate the settings page and be saved in the database.

Description

optionsframework_options(); 

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


Usage

  1. if ( !function_exists( 'optionsframework_options' ) ) { 
  2. require_once '/options.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = optionsframework_options(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/options.php  
  1. function optionsframework_options() { 
  2.  
  3. // Color schemes 
  4. $color_scheme = array("red" => __('Red', 'evolved'), "green" => __('Green', 'evolved'), "blue" => __('Blue', 'evolved'), "orange" =>__('Orange', 'evolved')); 
  5. // HomePage layout 
  6. $hp_layout = array("1" => __('Display full content for each post', 'evolved'), "2" => __('Display excerpt and big thumbnail', 'evolved'), "3" => __('Display excerpt and small thumbnail', 'evolved')); 
  7. // HomePage include 
  8. $hp_include = array( 
  9. 'evolved_game_reviews' => __('Game Reviews', 'evolved'),  
  10. 'evolved_video' => __('Videos', 'evolved') 
  11. ); 
  12. $radio = array("0" => __('No', 'evolved'), "1" => __('Yes', 'evolved')); 
  13. $slider_type = array ("1" => __('Default Nivo Slider', 'evolved'), "2" => __('Nivo Slider with thumbs navigation', 'evolved')); 
  14. // Pull all the categories into an array 
  15. $options_categories = array();  
  16. $options_categories_obj = get_categories(); 
  17. foreach ($options_categories_obj as $category) { 
  18. $options_categories[$category->cat_ID] = $category->cat_name; 
  19.  
  20. // Pull all the pages into an array 
  21. $options_pages = array();  
  22. $options_pages_obj = get_pages('sort_column=post_parent, menu_order'); 
  23. $options_pages[''] = 'Select a page:'; 
  24. foreach ($options_pages_obj as $page) { 
  25. $options_pages[$page->ID] = $page->post_title; 
  26.  
  27. // If using image radio buttons, define a directory path 
  28. $imagepath = get_stylesheet_directory_uri() . '/images/'; 
  29.  
  30. $options = array(); 
  31.  
  32. $options[] = array( "name" => __('Basic settings', 'evolved'),  
  33. "type" => "heading");  
  34.  
  35. $options[] = array( "name" => __('Color scheme', 'evolved'),  
  36. "desc" => __('Select color scheme.', 'evolved'),  
  37. "id" => "color_scheme",  
  38. "std" => "one",  
  39. "type" => "select",  
  40. "class" => "mini", //mini, tiny, small 
  41. "options" => $color_scheme); 
  42.  
  43. $options[] = array( "name" => __('Custom logo image', 'evolved'),  
  44. "desc" => __('You can upload custom image for your website logo (optional).', 'evolved'),  
  45. "id" => "logo_image",  
  46. "type" => "upload"); 
  47.  
  48. $options[] = array( "name" => __('Do You want to use custom favicon?', 'evolved'),  
  49. "id" => "favicon_radio",  
  50. "std" => "0",  
  51. "type" => "radio",  
  52. "options" => $radio);  
  53.  
  54. $options[] = array( "name" => __('Favicon URL', 'evolved'),  
  55. "desc" => __('If You choose to use custom favicon, input here FULL URL to the favicon.ico image.', 'evolved'),  
  56. "id" => "favicon_url",  
  57. "type" => "text"); 
  58.  
  59. $options[] = array( "name" => __('Home Page settings', 'evolved'),  
  60. "type" => "heading");  
  61.  
  62. $options[] = array( "name" => __('Home Page layout', 'evolved'),  
  63. "id" => "hp_layout",  
  64. "std" => "1",  
  65. "type" => "select",  
  66. "options" => $hp_layout); 
  67.  
  68. $options[] = array( "name" => __('Select custom post types, that You want to include on the home page', 'evolved'),  
  69. "desc" => __('These custom post types will be also included in archives pages', 'evolved'),  
  70. "id" => "hp_include",  
  71. "std" => "one",  
  72. "type" => "multicheck",  
  73. "options" => $hp_include); 
  74.  
  75. $options[] = array( "name" => __('Do You want to display image slider on the Home Page?', 'evolved'),  
  76. "id" => "slider_radio",  
  77. "std" => "0",  
  78. "type" => "radio",  
  79. "options" => $radio); 
  80.  
  81. $options[] = array( "name" => __('Select Category for Featured Posts slider', 'evolved'),  
  82. "desc" => __('Posts from this category will be rotating in image slider on the Home Page. IMPORTANT: Make sure all posts in this category have Featured Image set.', 'evolved'),  
  83. "id" => "slider_category",  
  84. "type" => "select",  
  85. "options" => $options_categories);  
  86.  
  87. $options[] = array( "name" => __('Slider type', 'evolved'),  
  88. "id" => "slider_type",  
  89. "std" => "1",  
  90. "type" => "select",  
  91. "class" => "mini", //mini, tiny, small 
  92. "options" => $slider_type); 
  93. return $options;