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 skt-parallaxme 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. // array of section content. 
  4. $section_text = array( 
  5. 1 => array( 
  6. 'section_title' => 'Welcome to the <strong>Parallax <span>Me</span></strong>',  
  7. 'menu_title' => '',  
  8. 'bgcolor' => '#ffffff',  
  9. 'bgimage' => '',  
  10. 'class' => 'services cf',  
  11. 'content' => '<p class="lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper diam metus, ac laoreet justo fringilla sed. Integer sit amet erat libero. Vivamus consectetur facilisis fringilla. In cursus nisi non rhoncus aliquam. In sed augue massa. Ut congue mi vel tellus ultrices imperdiet. Praesent varius massa ornare, fermentum ipsum sed, tristique nisi. Aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper diam metus, ac laoreet justo fringilla sed. Integer sit amet erat libero. Vivamus consectetur facilisis fringilla. In cursus nisi non rhoncus aliquam. In sed augue massa. Ut congue mi vel tellus ultrices imperdiet. Praesent varius massa ornare, fermentum ipsum sed, tristique nisi. Aliquam erat volutpat.</p>' 
  12. ),  
  13. 2 => array( 
  14. 'section_title' => 'Who We Are',  
  15. 'menu_title' => 'ABOUT',  
  16. 'bgcolor' => '#f6f6f6',  
  17. 'bgimage' => '',  
  18. 'class' => 'parallaxme',  
  19. 'content' => '<p>Aenean et volutpat augue. Cras vitae tellus eget nunc sagittis cursus a quis leo. Curabitur lobortis, ligula ut dapibus semper, dui eros egestas sem, a tempus sapien turpis sit amet turpis. Sed viverra facilisis orci eget porta.</p><p>Fusce lacinia est in porta interdum. In quis iaculis augue. In euismod odio nec quam rutrum, quis gravida eros blandit. Morbi consectetur sapien nec euismod viverra. Mauris iaculis congue sapien et dictum. Maecenas iaculis mauris quis magna congue tempus.</p><p> Suspendisse pharetra elit vitae pellentesque tempor. Etiam ut bibendum enim. Vestibulum velit odio, rhoncus vitae orci semper, imperdiet pellentesque diam. Suspendisse potenti. Sed ac facilisis justo. </p>' 
  20. ),  
  21. 3 => array( 
  22. 'section_title' => 'Services',  
  23. 'menu_title' => 'Services',  
  24. 'bgcolor' => '#f0f1ec',  
  25. 'bgimage' => get_template_directory_uri().'/images/section-test-bg.jpg',  
  26. 'class' => 'services_txt cf',  
  27. 'content' => ' 
  28. <div class="service-icons"> 
  29. <div class="columns five item alpha"> 
  30. <p><img src="'.get_template_directory_uri().'/images/service01.png" alt="Service" /></p> 
  31. <h2>Web Design</h2> 
  32. <p>Donec velit augue, scelerisque non dignissim non, commodo eget erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 
  33. </div> 
  34. <div class="columns five item"> 
  35. <p><img src="'.get_template_directory_uri().'/images/service02.png" alt="Service" /></p> 
  36. <h2>Mobile Website</h2> 
  37. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec velit augue, scelerisque non dignissim non, commodo eget erat.</p> 
  38. </div> 
  39. <div class="columns five item omega"> 
  40. <p><img src="'.get_template_directory_uri().'/images/service03.png" alt="Service" /></p> 
  41. <h2>Wordpress Themes</h2> 
  42. <p>Donec velit augue, scelerisque non dignissim non, commodo eget erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 
  43. </div> 
  44. </div>' 
  45. ),  
  46. 4 => array( 
  47. 'section_title' => 'Photo Gallery',  
  48. 'menu_title' => 'Gallery',  
  49. 'bgcolor' => '#f6f6f6',  
  50. 'bgimage' => '',  
  51. 'class' => '',  
  52. 'content' => '<div class="photobooth cf"> 
  53. <div class="gallery"> 
  54. <ul class="clean" id="portfolio"> 
  55. <li class="images"> 
  56. <strong>Image 1</strong><em><span>Image 1</span></em><a href="'.get_template_directory_uri().'/images/gallery/img01.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img01.jpg" width="313" height="225" /></a></li> 
  57. <li class="images"> 
  58. <strong>Image 2</strong><em><span>Image 2</span></em><a href="'.get_template_directory_uri().'/images/gallery/img02.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img02.jpg" width="313" height="225" /></a></li> 
  59. <li class="images"> 
  60. <strong>Image 3</strong><em><span>Image 3</span></em><a href="'.get_template_directory_uri().'/images/gallery/img03.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img03.jpg" width="313" height="225" /></a></li> 
  61. <li class="images"> 
  62. <strong>Image 4</strong><em><span>Image 4</span></em><a href="'.get_template_directory_uri().'/images/gallery/img04.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img04.jpg" width="313" height="225" /></a></li> 
  63. <li class="images"> 
  64. <strong>Image 5</strong><em><span>Image 5</span></em><a href="'.get_template_directory_uri().'/images/gallery/img05.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img05.jpg" width="313" height="225" /></a></li> 
  65. <li class="images"> 
  66. <strong>Image 6</strong><em><span>Image 6</span></em><a href="'.get_template_directory_uri().'/images/gallery/img06.jpg" rel="prettyPhoto[pp_gal]"><img src="'.get_template_directory_uri().'/images/gallery/img06.jpg" width="313" height="225" /></a></li> 
  67.  
  68.  
  69. </ul> 
  70. </div> 
  71. </div>' 
  72. ),  
  73. 5 => array( 
  74. 'section_title' => 'Features',  
  75. 'menu_title' => 'Blog',  
  76. 'bgcolor' => '#ffffff',  
  77. 'bgimage' => '',  
  78. 'class' => '',  
  79. 'content' => '<div class="service-icons"><div class="columns five item alpha "> 
  80. <p><a href="#" title="Lorem ipsum dolor"><img src="'.get_template_directory_uri().'/images/service01.png" class="attachment-thumbnail wp-post-image" alt="blog01"></a></p> 
  81. <h2><a href="#" title="Lorem ipsum dolor">Responsive</a></h2> 
  82. <p>Vivamus pellentesque pretium est eu molestie. Ut ut tincidunt turpis. Aliquam pretium vulputate pretium. Vivamus imperdiet lectus velit, a rutrum</p> 
  83. </div><div class="columns five item "> 
  84. <p><a href="#" title=""><img src="'.get_template_directory_uri().'/images/service02.png" class="attachment-thumbnail wp-post-image" alt="blog02"></a></p> 
  85. <h2><a href="#" title="">Fast Loading</a></h2> 
  86. <p>Phasellus fermentum augue vulputate, pulvinar odio in, semper risus. Donec rhoncus dolor in tortor venenatis, ac pharetra mauris venenatis. Aliquam</p> 
  87. </div><div class="columns five item omega"> 
  88. <p><a href="#" title="Hello world!"><img src="'.get_template_directory_uri().'/images/service03.png" class="attachment-thumbnail wp-post-image" alt="blog03"></a></p> 
  89. <h2><a href="" title="">Customizable</a></h2> 
  90. <p>Phasellus fermentum augue vulputate, pulvinar odio in, semper risus. Donec rhoncus dolor in tortor venenatis, ac pharetra mauris venenatis. Aliquam</p> 
  91. </div><div class="clear"></div>' 
  92. ),  
  93. 6 => array( 
  94. 'section_title' => 'Contact Us',  
  95. 'menu_title' => 'Contact',  
  96. 'bgcolor' => '#f6f6f6',  
  97. 'bgimage' => '',  
  98. 'class' => 'hello cf',  
  99. 'content' => '<h2><strong>Parallax-Me</strong></h2> 
  100. <p>123, Test Street Ave<br>Saltlake City, Utah<br>United States</p> 
  101. <p>Email: <u><a href="#">you@example-mail.com </a></u></p> 
  102. <p>Phone: 111-222-3333</p> 
  103. <p>Fax: 333-444-5555</p> 
  104. <p>Mobile: 222-333-4444</p>' 
  105. ),  
  106. ); 
  107.  
  108. $options = array(); 
  109.  
  110. //Basic Settings 
  111. $options[] = array( 
  112. 'name' => __('Basic Settings', 'skt-parallaxme'),  
  113. 'type' => 'heading'); 
  114.  
  115. $options[] = array( 
  116. 'name' => __('Logo', 'skt-parallaxme'),  
  117. 'desc' => __('Upload your main logo here', 'skt-parallaxme'),  
  118. 'id' => 'logo',  
  119. 'class' => '',  
  120. 'std' => "",  
  121. 'type' => 'upload'); 
  122.  
  123. $options[] = array( 
  124. 'name' => __('Favicon', 'skt-parallaxme'),  
  125. 'desc' => __('Upload favicon for website', 'skt-parallaxme'),  
  126. 'id' => 'favicon',  
  127. 'class' => '',  
  128. 'std' => ' ',  
  129. 'type' => 'upload'); 
  130.  
  131. $options[] = array( 
  132. 'name' => __('Footer Logo', 'skt-parallaxme'),  
  133. 'desc' => __('Upload footer logo here', 'skt-parallaxme'),  
  134. 'id' => 'footerlogo',  
  135. 'class' => '',  
  136. 'std' => "",  
  137. 'type' => 'upload'); 
  138.  
  139. $options[] = array( 
  140. 'name' => __('Footer Right (Designed by) Text', 'skt-parallaxme'),  
  141. 'desc' => __('Some text for footer of your site, you would like to display in the footer.', 'skt-parallaxme'),  
  142. 'id' => 'footertext',  
  143. 'std' => '© 2014. Design by <a target="_blank" href="'.esc_url('http://sktthemes.net').'">SKT Themes</a>',  
  144. 'type' => 'textarea'); 
  145.  
  146. $options[] = array( 
  147. 'name' => __('Custom CSS', 'skt-parallaxme'),  
  148. 'desc' => __('Some Custom Styling for your site. Place any css codes here instead of the style.css file.', 'skt-parallaxme'),  
  149. 'id' => 'style2',  
  150. 'std' => '',  
  151. 'type' => 'textarea'); 
  152.  
  153.  
  154. //Layout Settings 
  155. $options[] = array( 
  156. 'name' => __('Sections', 'skt-parallaxme'),  
  157. 'type' => 'heading'); 
  158.  
  159. $options[] = array( 
  160. 'name' => __('Number of Sections', 'skt-parallaxme'),  
  161. 'desc' => __('Select number of sections', 'skt-parallaxme'),  
  162. 'id' => 'numsection',  
  163. 'type' => 'select',  
  164. 'std' => '6',  
  165. 'options' => array_combine(range(1, 10), range(1, 10)) ); 
  166.  
  167. $numsecs = of_get_option( 'numsection', 6 ); 
  168.  
  169. for( $n=1; $n<=$numsecs; $n++) { 
  170. $options[] = array( 
  171. 'desc' => __("<h3>Section</h3>", 'skt-parallaxme'),  
  172. 'class' => 'toggle_title',  
  173. 'type' => 'info');  
  174.  
  175. $options[] = array( 
  176. 'name' => __('Section Title', 'skt-parallaxme'),  
  177. 'id' => 'sectiontitle'.$n,  
  178. 'std' => ( ( isset($section_text[$n]['section_title']) ) ? $section_text[$n]['section_title'] : '' ),  
  179. 'type' => 'text'); 
  180.  
  181. $options[] = array( 
  182. 'name' => __('Menu Title', 'skt-parallaxme'),  
  183. 'desc' => __('This title will display in the header menu. Leave blank to hide in menu', 'skt-parallaxme'),  
  184. 'id' => 'menutitle'.$n,  
  185. 'std' => ( ( isset($section_text[$n]['menu_title']) ) ? $section_text[$n]['menu_title'] : '' ),  
  186. 'type' => 'text'); 
  187.  
  188. $options[] = array( 
  189. 'name' => __('Section CSS Class', 'skt-parallaxme'),  
  190. 'desc' => __('Set class for this section.', 'skt-parallaxme'),  
  191. 'id' => 'sectionclass'.$n,  
  192. 'std' => ( ( isset($section_text[$n]['class']) ) ? $section_text[$n]['class'] : '' ),  
  193. 'type' => 'text'); 
  194.  
  195. $options[] = array( 
  196. 'name' => __('Section Content', 'skt-parallaxme'),  
  197. 'id' => 'sectioncontent'.$n,  
  198. 'std' => ( ( isset($section_text[$n]['content']) ) ? $section_text[$n]['content'] : '' ),  
  199. 'type' => 'editor'); 
  200.  
  201.  
  202. //SLIDER SETTINGS 
  203. $options[] = array( 
  204. 'name' => __('Homepage Slider', 'skt-parallaxme'),  
  205. 'type' => 'heading'); 
  206.  
  207. $options[] = array( 
  208. 'name' => __('Inner Page Slider', 'skt-parallaxme'),  
  209. 'desc' => __('Show / Hide inner page slider', 'skt-parallaxme'),  
  210. 'id' => 'innerpageslider',  
  211. 'type' => 'select',  
  212. 'std' => 'hide',  
  213. 'options' => array('show'=>'Show', 'hide'=>'Hide') ); 
  214.  
  215. $options[] = array( 
  216. 'name' => __('Slider Image 1', 'skt-parallaxme'),  
  217. 'desc' => __('Upload / select image for slide 1', 'skt-parallaxme'),  
  218. 'id' => 'slide1',  
  219. 'class' => '',  
  220. 'std' => get_template_directory_uri()."/images/slides/slide01.jpg",  
  221. 'type' => 'upload'); 
  222.  
  223. $options[] = array( 
  224. 'desc' => __('Title 1', 'skt-parallaxme'),  
  225. 'id' => 'slidetitle1',  
  226. 'std' => 'Awesome' ,  
  227. 'type' => 'text'); 
  228.  
  229. $options[] = array( 
  230. 'name' => __('Slider Image 2', 'skt-parallaxme'),  
  231. 'desc' => __('Upload / select image for slide 2', 'skt-parallaxme'),  
  232. 'id' => 'slide2',  
  233. 'class' => '',  
  234. 'std' => get_template_directory_uri()."/images/slides/slide02.jpg",  
  235. 'type' => 'upload'); 
  236.  
  237. $options[] = array( 
  238. 'desc' => __('Title 2', 'skt-parallaxme'),  
  239. 'id' => 'slidetitle2',  
  240. 'std' => 'Design' ,  
  241. 'type' => 'text'); 
  242.  
  243. $options[] = array( 
  244. 'name' => __('Slider Image 3', 'skt-parallaxme'),  
  245. 'desc' => __('Upload / select image for slide 3', 'skt-parallaxme'),  
  246. 'id' => 'slide3',  
  247. 'class' => '',  
  248. 'std' => get_template_directory_uri()."/images/slides/slide03.jpg",  
  249. 'type' => 'upload'); 
  250.  
  251. $options[] = array( 
  252. 'desc' => __('Title 3', 'skt-parallaxme'),  
  253. 'id' => 'slidetitle3',  
  254. 'std' => 'Meets' ,  
  255. 'type' => 'text'); 
  256.  
  257. $options[] = array( 
  258. 'name' => __('Slider Image 4', 'skt-parallaxme'),  
  259. 'desc' => __('Upload / select image for slide 4', 'skt-parallaxme'),  
  260. 'id' => 'slide4',  
  261. 'class' => '',  
  262. 'std' => get_template_directory_uri()."/images/slides/slide04.jpg",  
  263. 'type' => 'upload'); 
  264.  
  265. $options[] = array( 
  266. 'desc' => __('Title 4', 'skt-parallaxme'),  
  267. 'id' => 'slidetitle4',  
  268. 'std' => 'Easy' ,  
  269. 'type' => 'text'); 
  270.  
  271. $options[] = array( 
  272. 'name' => __('Slider Image 5', 'skt-parallaxme'),  
  273. 'desc' => __('Upload / select image for slide 5', 'skt-parallaxme'),  
  274. 'id' => 'slide5',  
  275. 'class' => '',  
  276. 'std' => get_template_directory_uri()."/images/slides/slide05.jpg",  
  277. 'type' => 'upload'); 
  278.  
  279. $options[] = array( 
  280. 'desc' => __('Title 5', 'skt-parallaxme'),  
  281. 'id' => 'slidetitle5',  
  282. 'std' => 'Set-up' ,  
  283. 'type' => 'text'); 
  284.  
  285.  
  286. //Social Settings 
  287. $options[] = array( 
  288. 'name' => __('Social Settings', 'skt-parallaxme'),  
  289. 'type' => 'heading'); 
  290.  
  291. $options[] = array( 
  292. 'desc' => __('Please set the value of following fields, as per the instructions given along. If you do not want to use an icon, just leave it blank. If some icons are showing up, even when no value is set then make sure they are completely blank, and just save the options once. They will not be shown anymore.', 'skt-parallaxme'),  
  293. 'type' => 'info'); 
  294.  
  295. $options[] = array( 
  296. 'name' => __('Facebook', 'skt-parallaxme'),  
  297. 'desc' => __('Facebook Profile or Page URL i.e. http://facebook.com/username/ ', 'skt-parallaxme'),  
  298. 'id' => 'facebook',  
  299. 'std' => '#',  
  300. 'type' => 'text',  
  301. 'subtype' => 'url'); 
  302.  
  303. $options[] = array( 
  304. 'name' => __('Twitter', 'skt-parallaxme'),  
  305. 'desc' => __('Twitter Username', 'skt-parallaxme'),  
  306. 'id' => 'twitter',  
  307. 'std' => '#',  
  308. 'type' => 'text',  
  309. 'subtype' => 'url'); 
  310.  
  311. $options[] = array( 
  312. 'name' => __('Google Plus', 'skt-parallaxme'),  
  313. 'desc' => __('Google Plus profile url, including "http://"', 'skt-parallaxme'),  
  314. 'id' => 'google',  
  315. 'std' => '#',  
  316. 'type' => 'text',  
  317. 'subtype' => 'url'); 
  318.  
  319. $options[] = array( 
  320. 'name' => __('Linkedin', 'skt-parallaxme'),  
  321. 'desc' => __('Linkedin URL', 'skt-parallaxme'),  
  322. 'id' => 'linkedin',  
  323. 'std' => '#',  
  324. 'type' => 'text',  
  325. 'subtype' => 'url');  
  326.  
  327. $options[] = array( 
  328. 'name' => __('YouTube', 'skt-parallaxme'),  
  329. 'desc' => __('YouTube URL', 'skt-parallaxme'),  
  330. 'id' => 'youtube',  
  331. 'std' => '#',  
  332. 'type' => 'text',  
  333. 'subtype' => 'url'); 
  334.  
  335. // Support  
  336. $options[] = array( 
  337. 'name' => __('Our Themes', 'skt-parallaxme'),  
  338. 'type' => 'heading'); 
  339.  
  340. $options[] = array( 
  341. 'desc' => __('SKT Parallax Me WordPress theme has been Designed and Created by SKT Themes.', 'skt-parallaxme'),  
  342. 'type' => 'info');  
  343.  
  344. $options[] = array( 
  345. 'desc' => __('<a href="'.esc_url(SKT_THEME_URL).'" target="_blank"><img src="'.get_template_directory_uri().'/images/sktskill.jpg"></a><p><em><a target="_blank" href="'.esc_url('http://www.sktthemes.net/shop/skt_parallax_me_pro/').'">Buy PRO version for only $39 with more features.</a></em></p>', 'skt-parallaxme'),  
  346. 'type' => 'info');  
  347.  
  348. return $options;