Advertisement
asif90

Theme option(part-1)

Dec 8th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.51 KB | None | 0 0
  1. Skip to content
  2.  
  3. Search…
  4. All gists
  5. GitHub
  6. Sign up for a GitHub account Sign in
  7. Create a gist now
  8. Instantly share code, notes, and snippets.
  9.  
  10. Star 0 Fork 0 @raziul1raziul1/Theme Option Fremwork Secret
  11. Created 5 months ago
  12. Embed
  13. <script src="https://gist.github.com/raziul1/15942ca4c629c318c1286ad4d66bb70e.js"></script>
  14. Download ZIP
  15. Code Revisions 1
  16. Raw
  17. Theme Option Fremwork
  18. // stock Theme Option framework
  19. function stock_theme_option( $options ) {
  20.  
  21. $options = array(); // remove old options
  22.  
  23. $options[] = array(
  24. 'name' => 'stock_header_setting',
  25. 'title' => 'Header Setting',
  26. 'icon' => 'fa fa-heart',
  27. 'fields' => array(
  28. array(
  29. 'id' => 'header_icon_box',
  30. 'type' => 'group',
  31. 'title' => 'Header Icon Box',
  32. 'button_title' => 'Add New',
  33. 'accordion_title' => 'Add New Box',
  34. 'fields' => array(
  35. array(
  36. 'id' => 'title',
  37. 'type' => 'text',
  38. 'title' => 'Title',
  39. ),
  40. array(
  41. 'id' => 'icon',
  42. 'type' => 'icon',
  43. 'title' => 'Icon',
  44. ),
  45. ),
  46. ),
  47.  
  48.  
  49. )
  50. );
  51.  
  52. $options[] = array(
  53. 'name' => 'stock_social_link',
  54. 'title' => 'stock Social Links',
  55. 'icon' => 'fa fa-heart',
  56. 'fields' => array(
  57. array(
  58. 'id' => 'social_links',
  59. 'type' => 'group',
  60. 'title' => 'Social links',
  61. 'button_title' => 'Add New',
  62. 'accordion_title' => 'Add New Social links',
  63. 'fields' => array(
  64. array(
  65. 'id' => 'icon',
  66. 'type' => 'icon',
  67. 'title' => 'Icon',
  68. ),
  69. array(
  70. 'id' => 'link',
  71. 'type' => 'text',
  72. 'title' => 'Links',
  73. ),
  74. ),
  75. ),
  76.  
  77.  
  78. )
  79. );
  80.  
  81. $options[] = array(
  82. 'name' => 'stock_header_logo_setting',
  83. 'title' => 'Header Logo Setting',
  84. 'icon' => 'fa fa-heart',
  85. 'fields' => array(
  86. array(
  87. 'id' => 'enable_logo_image',
  88. 'type' => 'switcher',
  89. 'default' => true,
  90. 'title' => 'Enable Logo Image',
  91. ),
  92. array(
  93. 'id' => 'logo_image',
  94. 'type' => 'image',
  95. 'title' => 'Logo Image',
  96. 'dependency' => array('enable_logo_image', '==', 'true'),
  97. ),
  98. array(
  99. 'id' => 'logo_text',
  100. 'type' => 'text',
  101. 'title' => 'Logo text',
  102. 'dependency' => array('enable_logo_image', '==', 'false'),
  103. ),
  104.  
  105. )
  106. );
  107.  
  108. $options[] = array(
  109. 'name' => 'stock_typography_setting',
  110. 'title' => 'Typographyo Setting',
  111. 'icon' => 'fa fa-heart',
  112. 'fields' => array(
  113. array(
  114. 'id' => 'body_font',
  115. 'type' => 'typography',
  116. 'title' => 'Body Font',
  117. 'default' => array(
  118. 'family' => 'Titillium Web',
  119. 'variant' => '700',
  120. 'font' => 'google',
  121. ),
  122. ),
  123. array(
  124. 'id' => 'heading_font',
  125. 'type' => 'typography',
  126. 'title' => 'Heading Font',
  127. 'default' => array(
  128. 'family' => 'Roboto',
  129. 'variant' => '700',
  130. 'font' => 'google',
  131. ),
  132. ),
  133.  
  134. )
  135. );
  136.  
  137. $options[] = array(
  138. 'name' => 'stock_styling_setting',
  139. 'title' => 'Styling Setting',
  140. 'icon' => 'fa fa-heart',
  141. 'fields' => array(
  142. array(
  143. 'id' => 'enable_preloader',
  144. 'type' => 'switcher',
  145. 'default' => true,
  146. 'title' => 'Enable Preloader',
  147. ),
  148. array(
  149. 'id' => 'enable_box_layout',
  150. 'type' => 'switcher',
  151. 'default' => false,
  152. 'title' => 'Enable Box Layout',
  153. ),
  154. array(
  155. 'id' => 'body_bg',
  156. 'type' => 'image',
  157. 'title' => 'Body Background Image',
  158. 'dependency'=> array('enable_box_layout', '==', 'true')
  159. ),
  160. array(
  161. 'id' => 'body_bg_repeat',
  162. 'type' => 'select',
  163. 'title' => 'Body Background Repeat',
  164. 'default' => 'repeat',
  165. 'options' => array(
  166. 'repeat' => 'Repeat',
  167. 'no-repeat' => 'No Repeat',
  168. 'cover' => 'Cover',
  169. ),
  170. 'dependency'=> array('enable_box_layout', '==', 'true')
  171. ),
  172.  
  173. array(
  174. 'id' => 'body_bg_attachment',
  175. 'type' => 'select',
  176. 'title' => 'Body Background Attachment',
  177. 'default' => 'scroll',
  178. 'options' => array(
  179. 'scroll' => 'Scroll',
  180. 'fixed' => 'Fixed',
  181. ),
  182. 'dependency'=> array('enable_box_layout', '==', 'true')
  183. ),
  184.  
  185. )
  186. );
  187.  
  188. $options[] = array(
  189. 'name' => 'stock_blog_setting',
  190. 'title' => 'Blog Setting',
  191. 'icon' => 'fa fa-heart',
  192. 'fields' => array(
  193. array(
  194. 'id' => 'display_post_by',
  195. 'type' => 'switcher',
  196. 'default' => true,
  197. 'title' => 'Display Post By?',
  198. ),
  199. array(
  200. 'id' => 'display_post_date',
  201. 'type' => 'switcher',
  202. 'default' => true,
  203. 'title' => 'Display Post Date?',
  204. ),
  205. array(
  206. 'id' => 'display_post_commetn_count',
  207. 'type' => 'switcher',
  208. 'default' => true,
  209. 'title' => 'Display Comment Count?',
  210. ),
  211. array(
  212. 'id' => 'display_post_category',
  213. 'type' => 'switcher',
  214. 'default' => true,
  215. 'title' => 'Display Post Category?',
  216. ),
  217. array(
  218. 'id' => 'display_post_tag',
  219. 'type' => 'switcher',
  220. 'default' => true,
  221. 'title' => 'Display Post Tag?',
  222. ),
  223. array(
  224. 'id' => 'display_post_nav',
  225. 'type' => 'switcher',
  226. 'default' => true,
  227. 'title' => 'Enable next Pre link?',
  228. ),
  229.  
  230. )
  231. );
  232.  
  233. $options[] = array(
  234. 'name' => 'stock_footer_setting',
  235. 'title' => 'Footer Setting',
  236. 'icon' => 'fa fa-heart',
  237. 'fields' => array(
  238. array(
  239. 'id' => 'footer_bg_color',
  240. 'type' => 'color_picker',
  241. 'default' => '#131313',
  242. 'title' => 'Footer background Color',
  243. ),
  244.  
  245. array(
  246. 'id' => 'footer_text_color',
  247. 'type' => 'color_picker',
  248. 'default' => '#9d9d9d',
  249. 'title' => 'Footer Text Color',
  250. ),
  251.  
  252. array(
  253. 'id' => 'footer_heading_color',
  254. 'type' => 'color_picker',
  255. 'default' => '#ffffff',
  256. 'title' => 'Footer Text Color',
  257. ),
  258.  
  259. array(
  260. 'id' => 'footer_copyright_text',
  261. 'type' => 'textarea',
  262. 'default' => 'Copyright © 2016, All Rights Reserved',
  263. 'title' => 'Footer Copyright text',
  264. ),
  265.  
  266. )
  267. );
  268.  
  269. $options[] = array(
  270. 'name' => 'stock_script_setting',
  271. 'title' => 'Script Setting',
  272. 'icon' => 'fa fa-heart',
  273. 'fields' => array(
  274. array(
  275. 'id' => 'head_script',
  276. 'type' => 'textarea',
  277. 'sanitize' => false,
  278. 'title' => 'Head Script',
  279. 'desc' => 'Scripts Goes before closing </ head >',
  280. ),
  281. array(
  282. 'id' => 'body_start_script',
  283. 'type' => 'textarea',
  284. 'sanitize' => false,
  285. 'title' => 'Body Start Script',
  286. 'desc' => 'Scripts Goes after closing < body >',
  287. ),
  288. array(
  289. 'id' => 'body_end_script',
  290. 'type' => 'textarea',
  291. 'sanitize' => false,
  292. 'title' => 'Body End Script',
  293. 'desc' => 'Scripts Goes before closing </ body >',
  294. ),
  295.  
  296. )
  297. );
  298.  
  299. return $options;
  300.  
  301. }
  302. add_filter( 'cs_framework_options', 'stock_theme_option' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement