of_options

The ColorWay Theme of options function.

Description

of_options(); 

Usage

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

Defined (1)

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

/functions/theme-options.php  
  1. function of_options() { 
  2. // VARIABLES 
  3. $themename = get_theme_data(STYLESHEETPATH . '/style.css'); 
  4. $themename = $themename['Name']; 
  5. $shortname = "of"; 
  6.  
  7. // Populate OptionsFramework option in array for use in theme 
  8. global $of_options; 
  9. $of_options = get_option('of_options'); 
  10.  
  11. //Stylesheet Reader 
  12. $alt_stylesheets = array("black" => 
  13. "black", "brown" => "brown", "blue" => "blue", "green" => "green", "pink" => "pink", "purple" => "purple", "red" => "red", "yellow" => "yellow"); 
  14.  
  15. // Test data 
  16. $test_array = array("one" => "One", "two" => "Two", "three" => "Three", "four" => "Four", "five" => "Five"); 
  17.  
  18. // Multicheck Array 
  19. $multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle"); 
  20.  
  21. // Multicheck Defaults 
  22. $multicheck_defaults = array("one" => "1", "five" => "1"); 
  23.  
  24. // Background Defaults 
  25.  
  26. $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment'=>'scroll'); 
  27.  
  28.  
  29. // Pull all the categories into an array 
  30. $options_categories = array();  
  31. $options_categories_obj = get_categories(); 
  32. foreach ($options_categories_obj as $category) { 
  33. $options_categories[$category->cat_ID] = $category->cat_name; 
  34.  
  35. // Pull all the pages into an array 
  36. $options_pages = array();  
  37. $options_pages_obj = get_pages('sort_column=post_parent, menu_order'); 
  38. $options_pages[''] = 'Select a page:'; 
  39. foreach ($options_pages_obj as $page) { 
  40. $options_pages[$page->ID] = $page->post_title; 
  41.  
  42. // If using image radio buttons, define a directory path 
  43. $imagepath = get_bloginfo('stylesheet_directory') . '/images/'; 
  44.  
  45. $options = array(); 
  46.  
  47. $options[] = array( "name" => "General Settings",  
  48. "type" => "heading"); 
  49.  
  50. $options[] = array( "name" => "Custom Logo",  
  51. "desc" => "Choose your own logo. Optimal Size: 215px Wide by 55px Height",  
  52. "id" => "colorway_logo",  
  53. "type" => "upload"); 
  54.  
  55. $options[] = array( "name" => "Custom Favicon",  
  56. "desc" => "Specify a 16px x 16px image that will represent your website's favicon.",  
  57. "id" => "colorway_favicon",  
  58. "type" => "upload"); 
  59.  
  60. $options[] = array( "name" => "Tracking Code",  
  61. "desc" => "Paste your Google Analytics (or other) tracking code here.",  
  62. "id" => "colorway_analytics",  
  63. "std" => "",  
  64. "type" => "textarea");  
  65. $options[] = array( "name" => "Body Background Image",  
  66. "desc" => "Select image to change your website background",  
  67. "id" => "inkthemes_bodybg",  
  68. "std" => "",  
  69. "type" => "upload");  
  70. //****=============================================================================****// 
  71. //****-----------This code is used for creating slider settings--------------------****//  
  72. //****=============================================================================****//  
  73. $options[] = array( "name" => "Slider Settings",  
  74. "type" => "heading"); 
  75.  
  76. $options[] = array( "name" => "Slide1 Image",  
  77. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  78. "id" => "colorway_slideimage1",  
  79. "type" => "upload"); 
  80. $options[] = array( "name" => "Slide1 Heading",  
  81. "desc" => "Enter the Heading for Slide1",  
  82. "id" => "colorway_slideheading1",  
  83. "std" => "",  
  84. "type" => "text"); 
  85.  
  86. $options[] = array( "name" => "Slide1 Heading Link",  
  87. "desc" => "Enter the Link URL in Heading for Slide1",  
  88. "id" => "colorway_slidelink1",  
  89. "std" => "",  
  90. "type" => "text"); 
  91. $options[] = array( "name" => "Slide1 Description",  
  92. "desc" => "Description for Slide1",  
  93. "id" => "colorway_slidedescription1",  
  94. "std" => "",  
  95. "type" => "textarea"); 
  96. $options[] = array( "name" => "Slide2 Image",  
  97. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  98. "id" => "colorway_slideimage2",  
  99. "type" => "upload"); 
  100.  
  101. $options[] = array( "name" => "Slide2 Heading",  
  102. "desc" => "Enter the Heading for Slide2",  
  103. "id" => "colorway_slideheading2",  
  104. "std" => "",  
  105. "type" => "text"); 
  106.  
  107. $options[] = array( "name" => "Slide2 Heading Link",  
  108. "desc" => "Enter the Link URL in Heading for Slide2",  
  109. "id" => "colorway_slidelink2",  
  110. "std" => "",  
  111. "type" => "text"); 
  112. $options[] = array( "name" => "Slide2 Description",  
  113. "desc" => "Description for Slide2",  
  114. "id" => "colorway_slidedescription2",  
  115. "std" => "",  
  116. "type" => "textarea"); 
  117.  
  118. $options[] = array( "name" => "Slide3 Image",  
  119. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  120. "id" => "colorway_slideimage3",  
  121. "type" => "upload"); 
  122.  
  123. $options[] = array( "name" => "Slide3 Heading",  
  124. "desc" => "Enter the Heading for Slide3",  
  125. "id" => "colorway_slideheading3",  
  126. "std" => "",  
  127. "type" => "text"); 
  128.  
  129. $options[] = array( "name" => "Slide3 Heading Link",  
  130. "desc" => "Enter the Link URL in Heading for Slide3",  
  131. "id" => "colorway_slidelink3",  
  132. "std" => "",  
  133. "type" => "text"); 
  134. $options[] = array( "name" => "Slide3 Description",  
  135. "desc" => "Description for Slide3",  
  136. "id" => "colorway_slidedescription3",  
  137. "std" => "",  
  138. "type" => "textarea"); 
  139. $options[] = array( "name" => "Slide4 Image",  
  140. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  141. "id" => "colorway_slideimage4",  
  142. "type" => "upload"); 
  143.  
  144. $options[] = array( "name" => "Slide4 Heading",  
  145. "desc" => "Enter the Heading for Slide4",  
  146. "id" => "colorway_slideheading4",  
  147. "std" => "",  
  148. "type" => "text"); 
  149.  
  150. $options[] = array( "name" => "Slide4 Heading Link",  
  151. "desc" => "Enter the Link URL in Heading for Slide4",  
  152. "id" => "colorway_slidelink4",  
  153. "std" => "",  
  154. "type" => "text"); 
  155. $options[] = array( "name" => "Slide4 Description",  
  156. "desc" => "Description for Slide4",  
  157. "id" => "colorway_slidedescription4",  
  158. "std" => "",  
  159. "type" => "textarea"); 
  160. //****=============================================================================****// 
  161. //****-----------This code is used for creating home page feature content----------****//  
  162. //****=============================================================================****//  
  163. $options[] = array( "name" => "Home Page Settings",  
  164. "type" => "heading");  
  165.  
  166. $options[] = array( "name" => "Home Page Intro",  
  167. "desc" => "Enter your heading text for home page",  
  168. "id" => "inkthemes_mainheading",  
  169. "std" => "",  
  170. "type" => "text");  
  171. //***Code for first column***// 
  172. $options[] = array( "name" => "First Feature Image",  
  173. "desc" => "Choose image for your feature column first. Optimal size 198px x 115px",  
  174. "id" => "inkthemes_fimg1",  
  175. "std" => "",  
  176. "type" => "upload"); 
  177.  
  178. $options[] = array( "name" => "First Feature Heading",  
  179. "desc" => "Enter your heading line for first column",  
  180. "id" => "inkthemes_headline1",  
  181. "std" => "",  
  182. "type" => "text");  
  183.  
  184. $options[] = array( "name" => "First Feature Link",  
  185. "desc" => "Enter your link for feature column first",  
  186. "id" => "inkthemes_link1",  
  187. "std" => "",  
  188. "type" => "text");  
  189.  
  190. $options[] = array( "name" => "First Feature Content",  
  191. "desc" => "Enter your feature content for column first",  
  192. "id" => "inkthemes_feature1",  
  193. "std" => "",  
  194. "type" => "textarea"); 
  195.  
  196. //***Code for second column***//  
  197. $options[] = array( "name" => "Second Feature Image",  
  198. "desc" => "Choose image for your feature column second. Optimal size 198px x 115px",  
  199. "id" => "inkthemes_fimg2",  
  200. "std" => "",  
  201. "type" => "upload"); 
  202.  
  203. $options[] = array( "name" => "Second Feature Heading",  
  204. "desc" => "Enter your heading line for second column",  
  205. "id" => "inkthemes_headline2",  
  206. "std" => "",  
  207. "type" => "text"); 
  208.  
  209. $options[] = array( "name" => "Second Feature Link",  
  210. "desc" => "Enter your link for feature column second",  
  211. "id" => "inkthemes_link2",  
  212. "std" => "",  
  213. "type" => "text");  
  214.  
  215.  
  216. $options[] = array( "name" => "Second Feature Content",  
  217. "desc" => "Enter your feature content for column second",  
  218. "id" => "inkthemes_feature2",  
  219. "std" => "",  
  220. "type" => "textarea"); 
  221.  
  222.  
  223. //***Code for third column***//  
  224. $options[] = array( "name" => "Third Feature Image",  
  225. "desc" => "Choose image for your feature column thrid. Optimal size 198px x 115px",  
  226. "id" => "inkthemes_fimg3",  
  227. "std" => "",  
  228. "type" => "upload"); 
  229.  
  230. $options[] = array( "name" => "Third Feature Heading",  
  231. "desc" => "Enter your heading line for third column",  
  232. "id" => "inkthemes_headline3",  
  233. "std" => "",  
  234. "type" => "text"); 
  235.  
  236. $options[] = array( "name" => "Third Feature Link",  
  237. "desc" => "Enter your link for feature column third",  
  238. "id" => "inkthemes_link3",  
  239. "std" => "",  
  240. "type" => "text");  
  241.  
  242. $options[] = array( "name" => "Third Feature Content",  
  243. "desc" => "Enter your feature content for third column",  
  244. "id" => "inkthemes_feature3",  
  245. "std" => "",  
  246. "type" => "textarea"); 
  247.  
  248. //***Code for fourth column***//  
  249. $options[] = array( "name" => "Fourth Feature Image",  
  250. "desc" => "Choose image for your feature column fourth. Optimal size 198px x 115px",  
  251. "id" => "inkthemes_fimg4",  
  252. "std" => "",  
  253. "type" => "upload"); 
  254.  
  255. $options[] = array( "name" => "Fourth Feature Heading",  
  256. "desc" => "Enter your heading line for fourth column",  
  257. "id" => "inkthemes_headline4",  
  258. "std" => "",  
  259. "type" => "text");  
  260.  
  261. $options[] = array( "name" => "Fourth Feature link",  
  262. "desc" => "Enter your link for feature column fourth",  
  263. "id" => "inkthemes_link4",  
  264. "std" => "",  
  265. "type" => "text");  
  266.  
  267. $options[] = array( "name" => "Fourth Feature Content",  
  268. "desc" => "Enter your feature content for fourth column",  
  269. "id" => "inkthemes_feature4",  
  270. "std" => "",  
  271. "type" => "textarea");  
  272.  
  273. $options[] = array( "name" => "Home Page Testimonial",  
  274. "desc" => "Enter your text for homepage testimonial in short paragraph.",  
  275. "id" => "inkthemes_testimonial",  
  276. "std" => "",  
  277. "type" => "textarea");  
  278.  
  279. //****=============================================================================****// 
  280. //****-----------This code is used for creating color styleshteet options----------****//  
  281. //****=============================================================================****//  
  282. $options[] = array( "name" => "Styling Options",  
  283. "type" => "heading");  
  284. $options[] = array( "name" => "Theme Stylesheet",  
  285. "desc" => "Select your themes alternative color scheme.",  
  286. "id" => "colorway_altstylesheet",  
  287. "std" => "green",  
  288. "type" => "select",  
  289. "options" => $alt_stylesheets);  
  290.  
  291. $options[] = array( "name" => "Custom CSS",  
  292. "desc" => "Quickly add some CSS to your theme by adding it to this block.",  
  293. "id" => "colorway_customcss",  
  294. "std" => "",  
  295. "type" => "textarea");  
  296.  
  297. $options[] = array( "name" => "Footer Settings",  
  298. "type" => "heading"); 
  299. $options[] = array( "name" => "Facebook URL",  
  300. "desc" => "Enter your Facebook URL if you have one",  
  301. "id" => "colorway_facebook",  
  302. "std" => "",  
  303. "type" => "text");  
  304. $options[] = array( "name" => "Twitter URL",  
  305. "desc" => "Enter your Twitter URL if you have one",  
  306. "id" => "colorway_twitter",  
  307. "std" => "",  
  308. "type" => "text");  
  309.  
  310. $options[] = array( "name" => "RSS Feed URL",  
  311. "desc" => "Enter your RSS Feed URL if you have one",  
  312. "id" => "colorway_rss",  
  313. "std" => "",  
  314. "type" => "text");  
  315.  
  316. //****=============================================================================****// 
  317. //****-----------This code is used for creating color SEO description--------------****//  
  318. //****=============================================================================****//  
  319. $options[] = array( "name" => "SEO Options",  
  320. "type" => "heading"); 
  321. $options[] = array( "name" => "Meta Keywords (comma separated)",  
  322. "desc" => "Meta keywords provide search engines with additional information about topics that appear on your site. This only applies to your home page. Keyword Limit Maximum 8",  
  323. "id" => "colorway_keyword",  
  324. "std" => "",  
  325. "type" => "textarea");  
  326. $options[] = array( "name" => "Meta Description",  
  327. "desc" => "You should use meta descriptions to provide search engines with additional information about topics that appear on your site. This only applies to your home page.Optimal Length for Search Engines, Roughly 155 Characters",  
  328. "id" => "colorway_description",  
  329. "std" => "",  
  330. "type" => "textarea");  
  331. $options[] = array( "name" => "Meta Author Name",  
  332. "desc" => "You should write the full name of the author here. This only applies to your home page.",  
  333. "id" => "colorway_author",  
  334. "std" => "",  
  335. "type" => "text");  
  336. update_option('of_template', $options);  
  337. update_option('of_themename', $themename);  
  338. update_option('of_shortname', $shortname); 
  339.