Advertisement
Guest User

Untitled

a guest
Jan 9th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 115.50 KB | None | 0 0
  1. <?php
  2.  
  3. // ------------- Theme Customizer Options ------------//
  4. // Customizer Basic Settings
  5. function dh_switch_options($wp_customize) {
  6. $wp_customize->add_panel( 'divi_hack_options', array(
  7. 'priority' => 0,
  8. 'capability' => 'edit_theme_options',
  9. 'title' => __('Divi Hacks', 'divi-hacks'),
  10. 'description' => __('Extend the Theme Customizer', 'divi-hacks'),
  11. ));
  12.  
  13. $wp_customize->add_section('dh_typography_options', array(
  14. 'priority' => 0,
  15. 'title' => __('Typography', 'divi-hacks'),
  16. 'panel' => 'divi_hack_options',
  17. ));
  18.  
  19. $wp_customize->add_setting( 'dh_custom_heading_fonts', array(
  20. 'capability' => 'edit_theme_options',
  21. 'default' => false,
  22. 'transport' => 'refresh'
  23. ) );
  24.  
  25. $wp_customize->add_control( 'dh_custom_heading_fonts', array(
  26. 'section' => 'dh_typography_options',
  27. 'label' => __( 'Enable Custom Heading Styles' ),
  28. 'priority' => 0,
  29. 'type' => 'checkbox'
  30. ) );
  31.  
  32. $wp_customize->add_setting('dh_import_fonts', array(
  33. 'default' => '@import url(\'https://fonts.googleapis.com/css?family=Indie+Flower\');',
  34. 'capability' => 'edit_theme_options',
  35. 'sanitize_callback' => 'sanitize_text_field',
  36. ));
  37.  
  38. $wp_customize->add_setting( 'dh_body_font_weight', array(
  39. 'capability' => 'edit_theme_options',
  40. 'sanitize_callback' => 'dh_sanitize_select',
  41. 'default' => '400',
  42. ) );
  43.  
  44. $wp_customize->add_control( 'dh_body_font_weight', array(
  45. 'type' => 'select',
  46. 'section' => 'dh_typography_options',
  47. 'label' => __( 'Body Font Weight' ),
  48. 'choices' => array(
  49. '100' => __( '100' ),
  50. '200' => __( '200' ),
  51. '300' => __( '300' ),
  52. '400' => __( '400' ),
  53. '500' => __( '500' ),
  54. '600' => __( '600' ),
  55. '700' => __( '700' ),
  56. '800' => __( '800' ),
  57. '900' => __( '900' ),
  58. ),
  59. ) );
  60.  
  61. $wp_customize->add_control('dh_import_fonts', array(
  62. 'label' => __('@import Custom Fonts', 'divi-hacks'),
  63. 'section' => 'dh_typography_options',
  64. 'type' => 'textarea',
  65. 'settings' => 'dh_import_fonts'
  66. ));
  67.  
  68. $wp_customize->add_setting( 'dh_h1_color', array(
  69. 'default' => 'inherit',
  70. 'type' => 'option',
  71. 'capability' => 'edit_theme_options',
  72. 'sanitize_callback' => 'et_sanitize_alpha_color',
  73. ));
  74.  
  75. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h1_color', array(
  76. 'label' => esc_html__( 'H1 Color', 'Divi Hacks' ),
  77. 'section' => 'dh_typography_options',
  78. 'settings' => 'dh_h1_color',
  79. )));
  80.  
  81. $wp_customize->add_setting('dh_custom_h1', array(
  82. 'default' => 'font-family:inherit;',
  83. 'capability' => 'edit_theme_options',
  84. 'sanitize_callback' => 'sanitize_text_field',
  85. ));
  86.  
  87. $wp_customize->add_control('dh_custom_h1', array(
  88. 'label' => __('Custom H1 Styles', 'divi-hacks'),
  89. 'section' => 'dh_typography_options',
  90. 'type' => 'textarea',
  91. 'settings' => 'dh_custom_h1'
  92. ));
  93.  
  94. $wp_customize->add_setting( 'dh_h2_color', array(
  95. 'default' => 'inherit',
  96. 'type' => 'option',
  97. 'capability' => 'edit_theme_options',
  98. 'sanitize_callback' => 'et_sanitize_alpha_color',
  99. ));
  100.  
  101. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h2_color', array(
  102. 'label' => esc_html__( 'H2 Color', 'Divi Hacks' ),
  103. 'section' => 'dh_typography_options',
  104. 'settings' => 'dh_h2_color',
  105. )));
  106.  
  107. $wp_customize->add_setting('dh_custom_h2', array(
  108. 'default' => 'font-family:inherit;',
  109. 'capability' => 'edit_theme_options',
  110. 'sanitize_callback' => 'sanitize_text_field',
  111. ));
  112.  
  113. $wp_customize->add_control('dh_custom_h2', array(
  114. 'label' => __('Custom H2 Styles', 'divi-hacks'),
  115. 'section' => 'dh_typography_options',
  116. 'type' => 'textarea',
  117. 'settings' => 'dh_custom_h2'
  118. ));
  119.  
  120. $wp_customize->add_setting( 'dh_h3_color', array(
  121. 'default' => 'inherit',
  122. 'type' => 'option',
  123. 'capability' => 'edit_theme_options',
  124. 'sanitize_callback' => 'et_sanitize_alpha_color',
  125. ));
  126.  
  127. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h3_color', array(
  128. 'label' => esc_html__( 'H3 Color', 'Divi Hacks' ),
  129. 'section' => 'dh_typography_options',
  130. 'settings' => 'dh_h3_color',
  131. )));
  132.  
  133. $wp_customize->add_setting('dh_custom_h3', array(
  134. 'default' => 'font-family:inherit;',
  135. 'capability' => 'edit_theme_options',
  136. 'sanitize_callback' => 'sanitize_text_field',
  137. ));
  138.  
  139. $wp_customize->add_control('dh_custom_h3', array(
  140. 'label' => __('Custom H3 Styles', 'divi-hacks'),
  141. 'section' => 'dh_typography_options',
  142. 'type' => 'textarea',
  143. 'settings' => 'dh_custom_h3'
  144. ));
  145.  
  146. $wp_customize->add_setting( 'dh_h4_color', array(
  147. 'default' => 'inherit',
  148. 'type' => 'option',
  149. 'capability' => 'edit_theme_options',
  150. 'sanitize_callback' => 'et_sanitize_alpha_color',
  151. ));
  152.  
  153. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h4_color', array(
  154. 'label' => esc_html__( 'H4 Color', 'Divi Hacks' ),
  155. 'section' => 'dh_typography_options',
  156. 'settings' => 'dh_h4_color',
  157. )));
  158.  
  159. $wp_customize->add_setting('dh_custom_h4', array(
  160. 'default' => 'font-family:inherit;',
  161. 'capability' => 'edit_theme_options',
  162. 'sanitize_callback' => 'sanitize_text_field',
  163. ));
  164.  
  165. $wp_customize->add_control('dh_custom_h4', array(
  166. 'label' => __('Custom H4 Styles', 'divi-hacks'),
  167. 'section' => 'dh_typography_options',
  168. 'type' => 'textarea',
  169. 'settings' => 'dh_custom_h4'
  170. ));
  171.  
  172. $wp_customize->add_setting( 'dh_h5_color', array(
  173. 'default' => 'inherit',
  174. 'type' => 'option',
  175. 'capability' => 'edit_theme_options',
  176. 'sanitize_callback' => 'et_sanitize_alpha_color',
  177. ));
  178.  
  179. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h5_color', array(
  180. 'label' => esc_html__( 'H5 Color', 'Divi Hacks' ),
  181. 'section' => 'dh_typography_options',
  182. 'settings' => 'dh_h5_color',
  183. )));
  184.  
  185. $wp_customize->add_setting('dh_custom_h5', array(
  186. 'default' => 'font-family:inherit;',
  187. 'capability' => 'edit_theme_options',
  188. 'sanitize_callback' => 'sanitize_text_field',
  189. ));
  190.  
  191. $wp_customize->add_control('dh_custom_h5', array(
  192. 'label' => __('Custom H5 Styles', 'divi-hacks'),
  193. 'section' => 'dh_typography_options',
  194. 'type' => 'textarea',
  195. 'settings' => 'dh_custom_h5'
  196. ));
  197.  
  198. $wp_customize->add_setting( 'dh_h6_color', array(
  199. 'default' => 'inherit',
  200. 'type' => 'option',
  201. 'capability' => 'edit_theme_options',
  202. 'sanitize_callback' => 'et_sanitize_alpha_color',
  203. ));
  204.  
  205. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_h6_color', array(
  206. 'label' => esc_html__( 'H6 Color', 'Divi Hacks' ),
  207. 'section' => 'dh_typography_options',
  208. 'settings' => 'dh_h6_color',
  209. )));
  210.  
  211. $wp_customize->add_setting('dh_custom_h6', array(
  212. 'default' => 'font-family:inherit;',
  213. 'capability' => 'edit_theme_options',
  214. 'sanitize_callback' => 'sanitize_text_field',
  215. ));
  216.  
  217. $wp_customize->add_control('dh_custom_h6', array(
  218. 'label' => __('Custom H6 Styles', 'divi-hacks'),
  219. 'section' => 'dh_typography_options',
  220. 'type' => 'textarea',
  221. 'settings' => 'dh_custom_h6'
  222. ));
  223.  
  224. $wp_customize->add_section('dh_mobile_menu', array(
  225. 'priority' => 1,
  226. 'title' => __('Mobile Menu', 'divi-hacks'),
  227. 'panel' => 'divi_hack_options',
  228. ));
  229.  
  230. $wp_customize->add_setting( 'dh_custom_mobile_menu', array(
  231. 'capability' => 'edit_theme_options',
  232. 'sanitize_callback' => 'dh_sanitize_select',
  233. 'default' => 'default-mobile-menu',
  234. ) );
  235.  
  236. $wp_customize->add_control( 'dh_custom_mobile_menu', array(
  237. 'type' => 'select',
  238. 'section' => 'dh_mobile_menu',
  239. 'label' => __( 'Custom Mobile Menu Style' ),
  240. 'choices' => array(
  241. 'default-mobile-menu' => __( 'Default' ),
  242. 'divi-hacks-mobile-menu-fullscreen' => __( 'Full Screen' ),
  243. 'divi-hacks-mobile-menu-slide-in' => __( 'Slide In' ),
  244. ),
  245. ) );
  246.  
  247. $wp_customize->add_setting( 'dh_mobile_menu_bg', array(
  248. 'default' => 'rgba(0,0,0,0.8)',
  249. 'type' => 'option',
  250. 'capability' => 'edit_theme_options',
  251. 'sanitize_callback' => 'et_sanitize_alpha_color',
  252. ));
  253.  
  254. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_menu_bg', array(
  255. 'label' => esc_html__( 'Background', 'Divi Hacks' ),
  256. 'section' => 'dh_mobile_menu',
  257. 'settings' => 'dh_mobile_menu_bg',
  258. )));
  259.  
  260. $wp_customize->add_setting( 'dh_mobile_menu_gradient_1', array(
  261. 'default' => '#d2ff52',
  262. 'type' => 'option',
  263. 'capability' => 'edit_theme_options',
  264. 'sanitize_callback' => 'et_sanitize_alpha_color',
  265. ));
  266.  
  267. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_menu_gradient_1', array(
  268. 'label' => esc_html__( 'Mobile Menu Gradient Start Color', 'Divi Hacks' ),
  269. 'section' => 'dh_mobile_menu',
  270. 'settings' => 'dh_mobile_menu_gradient_1',
  271. )));
  272.  
  273. $wp_customize->add_setting( 'dh_mobile_menu_gradient_2', array(
  274. 'default' => '#91e842',
  275. 'type' => 'option',
  276. 'capability' => 'edit_theme_options',
  277. 'sanitize_callback' => 'et_sanitize_alpha_color',
  278. ));
  279.  
  280. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_menu_gradient_2', array(
  281. 'label' => esc_html__( 'Mobile Menu Gradient End Color', 'Divi Hacks' ),
  282. 'section' => 'dh_mobile_menu',
  283. 'settings' => 'dh_mobile_menu_gradient_2',
  284. )));
  285.  
  286. $wp_customize->add_setting( 'dh_mobile_menu_gradient_direction', array(
  287. 'capability' => 'edit_theme_options',
  288. 'sanitize_callback' => 'dh_sanitize_select',
  289. 'default' => 'left',
  290. ) );
  291.  
  292. $wp_customize->add_control( 'dh_mobile_menu_gradient_direction', array(
  293. 'type' => 'select',
  294. 'section' => 'dh_mobile_menu',
  295. 'label' => __( 'Mobile Menu Gradient Direction' ),
  296. 'choices' => array(
  297. 'top' => __( 'Vertical &darr;' ),
  298. 'left' => __( 'Horizontal &rarr;' ),
  299. 'topleft' => __( 'Diagonal &#8600;' ),
  300. 'topright' => __( 'Diagonal &#8601;' ),
  301. )));
  302.  
  303. $wp_customize->add_setting( 'dh_mobile_menu_text', array(
  304. 'default' => '#ffffff',
  305. 'type' => 'option',
  306. 'capability' => 'edit_theme_options',
  307. 'sanitize_callback' => 'et_sanitize_alpha_color',
  308. ));
  309.  
  310. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_menu_text', array(
  311. 'label' => esc_html__( 'Text Color', 'Divi Hacks' ),
  312. 'section' => 'dh_mobile_menu',
  313. 'settings' => 'dh_mobile_menu_text',
  314. )));
  315.  
  316. $wp_customize->add_setting( 'dh_mobile_closed_toggle_icon', array(
  317. 'default' => '#1b1d1e',
  318. 'type' => 'option',
  319. 'capability' => 'edit_theme_options',
  320. 'sanitize_callback' => 'et_sanitize_alpha_color',
  321. ));
  322.  
  323. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_closed_toggle_icon', array(
  324. 'label' => esc_html__( 'Open Menu Icon', 'Divi Hacks' ),
  325. 'section' => 'dh_mobile_menu',
  326. 'settings' => 'dh_mobile_closed_toggle_icon',
  327. )));
  328.  
  329. $wp_customize->add_setting( 'dh_mobile_cart_icon', array(
  330. 'default' => '#1b1d1e',
  331. 'type' => 'option',
  332. 'capability' => 'edit_theme_options',
  333. 'sanitize_callback' => 'et_sanitize_alpha_color',
  334. ));
  335.  
  336. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_cart_icon', array(
  337. 'label' => esc_html__( 'Cart Icon', 'Divi Hacks' ),
  338. 'section' => 'dh_mobile_menu',
  339. 'settings' => 'dh_mobile_cart_icon',
  340. )));
  341.  
  342. $wp_customize->add_setting( 'dh_mobile_open_toggle_icon', array(
  343. 'default' => '#1b1d1e',
  344. 'type' => 'option',
  345. 'capability' => 'edit_theme_options',
  346. 'sanitize_callback' => 'et_sanitize_alpha_color',
  347. ));
  348.  
  349. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_open_toggle_icon', array(
  350. 'label' => esc_html__( 'Close Menu Icon', 'Divi Hacks' ),
  351. 'section' => 'dh_mobile_menu',
  352. 'settings' => 'dh_mobile_open_toggle_icon',
  353. )));
  354.  
  355. $wp_customize->add_setting( 'dh_mobile_menu_current', array(
  356. 'default' => '#247BA0',
  357. 'type' => 'option',
  358. 'capability' => 'edit_theme_options',
  359. 'sanitize_callback' => 'et_sanitize_alpha_color',
  360. ));
  361.  
  362. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_menu_current', array(
  363. 'label' => esc_html__( 'Current Page Text Color', 'Divi Hacks' ),
  364. 'section' => 'dh_mobile_menu',
  365. 'settings' => 'dh_mobile_menu_current',
  366. )));
  367.  
  368. $wp_customize->add_setting( 'dh_mobile_submenu_bg_color', array(
  369. 'default' => 'rgba(0,0,0,0.1)',
  370. 'type' => 'option',
  371. 'capability' => 'edit_theme_options',
  372. 'sanitize_callback' => 'et_sanitize_alpha_color',
  373. ));
  374.  
  375. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_mobile_submenu_bg_color', array(
  376. 'label' => esc_html__( 'Submenu Background Color', 'Divi Hacks' ),
  377. 'section' => 'dh_mobile_menu',
  378. 'settings' => 'dh_mobile_submenu_bg_color',
  379. )));
  380.  
  381. $wp_customize->add_setting('dh_mobile_menu_letter_spacing', array(
  382. 'default' => '6px',
  383. 'type' => 'option',
  384. 'capability' => 'edit_theme_options',
  385. ));
  386.  
  387. $wp_customize->add_control('dh_mobile_menu_letter_spacing', array(
  388. 'label' => __('Letter Spacing', 'divi-hacks'),
  389. 'section' => 'dh_mobile_menu',
  390. 'type' => 'option',
  391. 'settings' => 'dh_mobile_menu_letter_spacing'
  392. ));
  393.  
  394. $wp_customize->add_setting('dh_mobile_menu_line_height', array(
  395. 'default' => '1.0em',
  396. 'type' => 'option',
  397. 'capability' => 'edit_theme_options',
  398. ));
  399.  
  400. $wp_customize->add_control('dh_mobile_menu_line_height', array(
  401. 'label' => __('Menu Item Line Height', 'divi-hacks'),
  402. 'section' => 'dh_mobile_menu',
  403. 'type' => 'option',
  404. 'settings' => 'dh_mobile_menu_line_height'
  405. ));
  406.  
  407. $wp_customize->add_setting('dh_mobile_menu_submenu_line_height', array(
  408. 'default' => '0.8em',
  409. 'type' => 'option',
  410. 'capability' => 'edit_theme_options',
  411. ));
  412.  
  413. $wp_customize->add_control('dh_mobile_menu_submenu_line_height', array(
  414. 'label' => __('Submenu Line Height', 'divi-hacks'),
  415. 'section' => 'dh_mobile_menu',
  416. 'type' => 'option',
  417. 'settings' => 'dh_mobile_menu_submenu_line_height'
  418. ));
  419.  
  420. $wp_customize->add_section('dh_global_menu_options', array(
  421. 'priority' => 15,
  422. 'title' => __('Global Menu Options', 'divi-hacks'),
  423. 'panel' => 'divi_hack_options',
  424. ));
  425.  
  426. $wp_customize->add_setting( 'dh_custom_menu_animations', array(
  427. 'capability' => 'edit_theme_options',
  428. 'sanitize_callback' => 'dh_sanitize_select',
  429. 'default' => 'no-menu-animation',
  430. ) );
  431.  
  432. $wp_customize->add_control( 'dh_custom_menu_animations', array(
  433. 'type' => 'select',
  434. 'section' => 'dh_global_menu_options',
  435. 'label' => __( 'Menu Animations' ),
  436. 'choices' => array(
  437. 'no-menu-animation' => __( 'None' ),
  438. 'divi-hacks-animenu-1' => __( 'Slide-In Underline' ),
  439. 'divi-hacks-animenu-2' => __( 'Grow Underline' ),
  440. 'divi-hacks-animenu-3' => __( 'Current Page Overline' ),
  441. ),
  442. ) );
  443.  
  444. $wp_customize->add_setting( 'dh_menu_animation_accent_color', array(
  445. 'default' => 'inherit',
  446. 'type' => 'option',
  447. 'capability' => 'edit_theme_options',
  448. 'sanitize_callback' => 'et_sanitize_alpha_color'
  449. ));
  450.  
  451. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_menu_animation_accent_color', array(
  452. 'label' => esc_html__( 'Menu Animation Accent Color', 'Divi Hacks' ),
  453. 'section' => 'dh_global_menu_options',
  454. 'settings' => 'dh_menu_animation_accent_color',
  455. )));
  456.  
  457. $wp_customize->add_setting( 'dh_disable_default_menu_hover', array(
  458. 'capability' => 'edit_theme_options',
  459. 'default' => false,
  460. 'transport' => 'refresh'
  461. ) );
  462.  
  463. $wp_customize->add_control( 'dh_disable_default_menu_hover', array(
  464. 'section' => 'dh_global_menu_options',
  465. 'label' => __( 'Disable menu item highlight and fade on hover' ),
  466. 'type' => 'checkbox'
  467. ) );
  468.  
  469. $wp_customize->add_section('dh_primary_menu_options', array(
  470. 'priority' => 15,
  471. 'title' => __('Primary Menu Bar', 'divi-hacks'),
  472. 'panel' => 'divi_hack_options',
  473. ));
  474.  
  475. $wp_customize->add_setting( 'dh_main_header_gradient_1', array(
  476. 'default' => 'rgba(0,0,0,0)',
  477. 'type' => 'option',
  478. 'capability' => 'edit_theme_options',
  479. 'sanitize_callback' => 'et_sanitize_alpha_color',
  480. ));
  481.  
  482. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_main_header_gradient_1', array(
  483. 'label' => esc_html__( 'Main Header Gradient Start Color', 'Divi Hacks' ),
  484. 'section' => 'dh_primary_menu_options',
  485. 'settings' => 'dh_main_header_gradient_1',
  486. )));
  487.  
  488. $wp_customize->add_setting( 'dh_main_header_gradient_2', array(
  489. 'default' => 'rgba(0,0,0,0)',
  490. 'type' => 'option',
  491. 'capability' => 'edit_theme_options',
  492. 'sanitize_callback' => 'et_sanitize_alpha_color',
  493. ));
  494.  
  495. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_main_header_gradient_2', array(
  496. 'label' => esc_html__( 'Main Header Gradient End Color', 'Divi Hacks' ),
  497. 'section' => 'dh_primary_menu_options',
  498. 'settings' => 'dh_main_header_gradient_2',
  499. )));
  500.  
  501. $wp_customize->add_setting( 'dh_header_bg', array(
  502. 'default' => '',
  503. 'type' => 'option',
  504. 'capability' => 'edit_theme_options',
  505. ));
  506.  
  507. $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'dh_header_bg', array(
  508. 'label' => __( 'Main Header Background Image', 'Divi Hacks' ),
  509. 'section' => 'dh_primary_menu_options',
  510. 'settings' => 'dh_header_bg',
  511. )));
  512.  
  513. $wp_customize->add_setting( 'dh_header_gradient_direction', array(
  514. 'capability' => 'edit_theme_options',
  515. 'sanitize_callback' => 'dh_sanitize_select',
  516. 'default' => 'left',
  517. ) );
  518.  
  519. $wp_customize->add_control( 'dh_header_gradient_direction', array(
  520. 'type' => 'select',
  521. 'section' => 'dh_primary_menu_options',
  522. 'label' => __( 'Main Header Gradient Direction' ),
  523. 'choices' => array(
  524. 'top' => __( 'Vertical &darr;' ),
  525. 'left' => __( 'Horizontal &rarr;' ),
  526. 'topleft' => __( 'Diagonal &#8600;' ),
  527. 'topright' => __( 'Diagonal &#8601;' ),
  528. ),
  529. ) );
  530.  
  531. $wp_customize->add_setting('dh_main_header_bg_size', array(
  532. 'default' => 'cover',
  533. 'type' => 'option',
  534. 'capability' => 'edit_theme_options',
  535. ));
  536.  
  537. $wp_customize->add_control('dh_main_header_bg_size', array(
  538. 'label' => __('Main Header Background Size', 'divi-hacks'),
  539. 'section' => 'dh_primary_menu_options',
  540. 'type' => 'option',
  541. 'settings' => 'dh_main_header_bg_size'
  542. ));
  543.  
  544. $wp_customize->add_setting('dh_main_header_bg_repeat', array(
  545. 'default' => 'no-repeat',
  546. 'type' => 'option',
  547. 'capability' => 'edit_theme_options',
  548. ));
  549.  
  550. $wp_customize->add_control('dh_main_header_bg_repeat', array(
  551. 'label' => __('Main Header Background Repeat', 'divi-hacks'),
  552. 'section' => 'dh_primary_menu_options',
  553. 'type' => 'option',
  554. 'settings' => 'dh_main_header_bg_repeat'
  555. ));
  556.  
  557. $wp_customize->add_setting('dh_main_header_bg_position', array(
  558. 'default' => 'center',
  559. 'type' => 'option',
  560. 'capability' => 'edit_theme_options',
  561. ));
  562.  
  563. $wp_customize->add_control('dh_main_header_bg_position', array(
  564. 'label' => __('Main Header Background Position', 'divi-hacks'),
  565. 'section' => 'dh_primary_menu_options',
  566. 'type' => 'option',
  567. 'settings' => 'dh_main_header_bg_position'
  568. ));
  569.  
  570. $wp_customize->add_setting('dh_logo_styles', array(
  571. 'default' => '',
  572. 'capability' => 'edit_theme_options',
  573. 'sanitize_callback' => 'sanitize_text_field',
  574. ));
  575.  
  576. $wp_customize->add_control('dh_logo_styles', array(
  577. 'label' => __('Logo CSS', 'divi-hacks'),
  578. 'section' => 'dh_primary_menu_options',
  579. 'type' => 'textarea',
  580. 'settings' => 'dh_logo_styles'
  581. ));
  582.  
  583. $wp_customize->add_setting('dh_primary_dropdown_width', array(
  584. 'default' => '240px',
  585. 'type' => 'option',
  586. 'capability' => 'edit_theme_options',
  587. ));
  588.  
  589. $wp_customize->add_control('dh_primary_dropdown_width', array(
  590. 'label' => __('Main Header Dropdown Width', 'divi-hacks'),
  591. 'section' => 'dh_primary_menu_options',
  592. 'type' => 'option',
  593. 'settings' => 'dh_primary_dropdown_width'
  594. ));
  595.  
  596. $wp_customize->add_setting('dh_primary_dropdown_line_height', array(
  597. 'default' => '1.2em',
  598. 'type' => 'option',
  599. 'capability' => 'edit_theme_options',
  600. ));
  601.  
  602. $wp_customize->add_control('dh_primary_dropdown_line_height', array(
  603. 'label' => __('Dropdown Line Height', 'divi-hacks'),
  604. 'section' => 'dh_primary_menu_options',
  605. 'type' => 'option',
  606. 'settings' => 'dh_primary_dropdown_line_height'
  607. ));
  608.  
  609. $wp_customize->add_setting( 'dh_primary_dropdown_link_color', array(
  610. 'default' => 'inherit',
  611. 'type' => 'option',
  612. 'capability' => 'edit_theme_options',
  613. 'sanitize_callback' => 'et_sanitize_alpha_color',
  614. ));
  615.  
  616. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_primary_dropdown_link_color', array(
  617. 'label' => esc_html__( 'Main Header Dropdown Link Color', 'Divi Hacks' ),
  618. 'section' => 'dh_primary_menu_options',
  619. 'settings' => 'dh_primary_dropdown_link_color',
  620. )));
  621.  
  622. $wp_customize->add_setting( 'dh_nav_columns_text_align', array(
  623. 'capability' => 'edit_theme_options',
  624. 'sanitize_callback' => 'dh_sanitize_select',
  625. 'default' => 'flex-start',
  626. ) );
  627.  
  628. $wp_customize->add_control( 'dh_nav_columns_text_align', array(
  629. 'type' => 'select',
  630. 'section' => 'dh_primary_menu_options',
  631. 'label' => __( 'Main Header Drop Down Text Alignment' ),
  632. 'choices' => array(
  633. 'flex-start' => __( 'Left' ),
  634. 'center' => __( 'Center' ),
  635. 'flex-end' => __( 'Right' ),
  636. ),
  637. ) );
  638.  
  639. $wp_customize->add_setting('dh_nav_columns_width', array(
  640. 'default' => '120px',
  641. 'type' => 'option',
  642. 'capability' => 'edit_theme_options',
  643. ));
  644.  
  645. $wp_customize->add_control('dh_nav_columns_width', array(
  646. 'label' => __('Main Header Dropdown Column Width', 'divi-hacks'),
  647. 'description' => __('Use this with the <a href="https://divihacks.com/docs/theme-customizations/#columns" target="_blank">Columns in Dropdowns</a> Hack to set the width of the columns.', 'divi-hacks'),
  648. 'section' => 'dh_primary_menu_options',
  649. 'type' => 'option',
  650. 'settings' => 'dh_nav_columns_width'
  651. ));
  652.  
  653. $wp_customize->add_setting('dh_nav_columns_line_height', array(
  654. 'default' => '2em',
  655. 'type' => 'option',
  656. 'capability' => 'edit_theme_options',
  657. ));
  658.  
  659. $wp_customize->add_control('dh_nav_columns_line_height', array(
  660. 'label' => __('Main Header Dropdown Link Line Height', 'divi-hacks'),
  661. 'section' => 'dh_primary_menu_options',
  662. 'type' => 'option',
  663. 'settings' => 'dh_nav_columns_line_height'
  664. ));
  665.  
  666. $wp_customize->add_setting('dh_nav_columns_left_padding', array(
  667. 'default' => '0px',
  668. 'type' => 'option',
  669. 'capability' => 'edit_theme_options',
  670. ));
  671.  
  672. $wp_customize->add_control('dh_nav_columns_left_padding', array(
  673. 'label' => __('Main Header Dropdown Column Left Padding', 'divi-hacks'),
  674. 'section' => 'dh_primary_menu_options',
  675. 'type' => 'option',
  676. 'settings' => 'dh_nav_columns_left_padding'
  677. ));
  678.  
  679. $wp_customize->add_setting('dh_nav_columns_right_padding', array(
  680. 'default' => '0px',
  681. 'type' => 'option',
  682. 'capability' => 'edit_theme_options',
  683. ));
  684.  
  685. $wp_customize->add_control('dh_nav_columns_right_padding', array(
  686. 'label' => __('Main Header Dropdown Column Right Padding', 'divi-hacks'),
  687. 'section' => 'dh_primary_menu_options',
  688. 'type' => 'option',
  689. 'settings' => 'dh_nav_columns_right_padding'
  690. ));
  691.  
  692. $wp_customize->add_setting( 'dh_top_icon_color', array(
  693. 'default' => 'inherit',
  694. 'type' => 'option',
  695. 'capability' => 'edit_theme_options',
  696. 'sanitize_callback' => 'et_sanitize_alpha_color',
  697. ));
  698.  
  699. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_top_icon_color', array(
  700. 'label' => esc_html__( 'Main Header Menu Bar Icon Color', 'Divi Hacks' ),
  701. 'section' => 'dh_primary_menu_options',
  702. 'settings' => 'dh_top_icon_color',
  703. )));
  704.  
  705. $wp_customize->add_setting( 'dh_dropdown_icon_color', array(
  706. 'default' => 'inherit',
  707. 'type' => 'option',
  708. 'capability' => 'edit_theme_options',
  709. 'sanitize_callback' => 'et_sanitize_alpha_color',
  710. ));
  711.  
  712. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_dropdown_icon_color', array(
  713. 'label' => esc_html__( 'Main Header Dropdown Icon Color', 'Divi Hacks' ),
  714. 'section' => 'dh_primary_menu_options',
  715. 'settings' => 'dh_dropdown_icon_color',
  716. )));
  717.  
  718. $wp_customize->add_setting('dh_nav_icon_size', array(
  719. 'default' => '1em',
  720. 'type' => 'option',
  721. 'capability' => 'edit_theme_options',
  722. ));
  723.  
  724. $wp_customize->add_control('dh_nav_icon_size', array(
  725. 'label' => __('Main Header Icon Size', 'divi-hacks'),
  726. 'section' => 'dh_primary_menu_options',
  727. 'type' => 'option',
  728. 'settings' => 'dh_nav_icon_size'
  729. ));
  730.  
  731. $wp_customize->add_setting('dh_mh_dropdown_parent_styles', array(
  732. 'default' => 'font-weight:bold; text-transform:uppercase; border-bottom:1px solid; padding-bottom:10px; margin-bottom:10px;',
  733. 'capability' => 'edit_theme_options',
  734. 'sanitize_callback' => 'sanitize_text_field',
  735. ));
  736.  
  737. $wp_customize->add_control('dh_mh_dropdown_parent_styles', array(
  738. 'label' => __('Main Header Dropdown Column Parent CSS', 'divi-hacks'),
  739. 'section' => 'dh_primary_menu_options',
  740. 'type' => 'textarea',
  741. 'settings' => 'dh_mh_dropdown_parent_styles'
  742. ));
  743.  
  744. $wp_customize->add_setting('dh_mh_current_page_styles', array(
  745. 'default' => '',
  746. 'capability' => 'edit_theme_options',
  747. 'sanitize_callback' => 'sanitize_text_field',
  748. ));
  749.  
  750. $wp_customize->add_control('dh_mh_current_page_styles', array(
  751. 'label' => __('Main Header Current Page Link CSS', 'divi-hacks'),
  752. 'section' => 'dh_primary_menu_options',
  753. 'type' => 'textarea',
  754. 'settings' => 'dh_mh_current_page_styles'
  755. ));
  756.  
  757. $wp_customize->add_section('dh_secondary_menu_options', array(
  758. 'priority' => 15,
  759. 'title' => __('Secondary Menu Bar', 'divi-hacks'),
  760. 'panel' => 'divi_hack_options',
  761. ));
  762.  
  763. $wp_customize->add_setting( 'dh_secondary_header_gradient_1', array(
  764. 'default' => 'rgba(0,0,0,0)',
  765. 'type' => 'option',
  766. 'capability' => 'edit_theme_options',
  767. 'sanitize_callback' => 'et_sanitize_alpha_color',
  768. ));
  769.  
  770. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_secondary_header_gradient_1', array(
  771. 'label' => esc_html__( 'Header Gradient Start Color', 'Divi Hacks' ),
  772. 'section' => 'dh_secondary_menu_options',
  773. 'settings' => 'dh_secondary_header_gradient_1',
  774. )));
  775.  
  776. $wp_customize->add_setting( 'dh_secondary_header_gradient_2', array(
  777. 'default' => 'rgba(0,0,0,0)',
  778. 'type' => 'option',
  779. 'capability' => 'edit_theme_options',
  780. 'sanitize_callback' => 'et_sanitize_alpha_color',
  781. ));
  782.  
  783. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_secondary_header_gradient_2', array(
  784. 'label' => esc_html__( 'Header Gradient End Color', 'Divi Hacks' ),
  785. 'section' => 'dh_secondary_menu_options',
  786. 'settings' => 'dh_secondary_header_gradient_2',
  787. )));
  788.  
  789. $wp_customize->add_setting( 'dh_secondary_header_gradient_direction', array(
  790. 'capability' => 'edit_theme_options',
  791. 'sanitize_callback' => 'dh_sanitize_select',
  792. 'default' => 'left',
  793. ) );
  794.  
  795. $wp_customize->add_control( 'dh_secondary_header_gradient_direction', array(
  796. 'type' => 'select',
  797. 'section' => 'dh_secondary_menu_options',
  798. 'label' => __( 'Gradient Direction' ),
  799. 'choices' => array(
  800. 'top' => __( 'Vertical &darr;' ),
  801. 'left' => __( 'Horizontal &rarr;' ),
  802. 'topleft' => __( 'Diagonal &#8600;' ),
  803. 'topright' => __( 'Diagonal &#8601;' ),
  804. ),
  805. ) );
  806.  
  807. $wp_customize->add_setting( 'dh_secondary_header_bg', array(
  808. 'default' => '',
  809. 'type' => 'option',
  810. 'capability' => 'edit_theme_options',
  811. ));
  812.  
  813. $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'dh_secondary_header_bg', array(
  814. 'label' => __( 'Header Background Image', 'Divi Hacks' ),
  815. 'section' => 'dh_secondary_menu_options',
  816. 'settings' => 'dh_secondary_header_bg',
  817. )));
  818.  
  819. $wp_customize->add_setting('dh_secondary_header_bg_size', array(
  820. 'default' => 'cover',
  821. 'type' => 'option',
  822. 'capability' => 'edit_theme_options',
  823. ));
  824.  
  825. $wp_customize->add_control('dh_secondary_header_bg_size', array(
  826. 'label' => __('Background Size', 'divi-hacks'),
  827. 'section' => 'dh_secondary_menu_options',
  828. 'type' => 'option',
  829. 'settings' => 'dh_secondary_header_bg_size'
  830. ));
  831.  
  832. $wp_customize->add_setting('dh_secondary_header_bg_repeat', array(
  833. 'default' => 'no-repeat',
  834. 'type' => 'option',
  835. 'capability' => 'edit_theme_options',
  836. ));
  837.  
  838. $wp_customize->add_control('dh_secondary_header_bg_repeat', array(
  839. 'label' => __('Background Repeat', 'divi-hacks'),
  840. 'section' => 'dh_secondary_menu_options',
  841. 'type' => 'option',
  842. 'settings' => 'dh_secondary_header_bg_repeat'
  843. ));
  844.  
  845. $wp_customize->add_setting('dh_secondary_header_bg_position', array(
  846. 'default' => 'center',
  847. 'type' => 'option',
  848. 'capability' => 'edit_theme_options',
  849. ));
  850.  
  851. $wp_customize->add_control('dh_secondary_header_bg_position', array(
  852. 'label' => __('Background Position', 'divi-hacks'),
  853. 'section' => 'dh_secondary_menu_options',
  854. 'type' => 'option',
  855. 'settings' => 'dh_secondary_header_bg_position'
  856. ));
  857.  
  858. $wp_customize->add_setting( 'dh_secondary_current_item_color', array(
  859. 'default' => 'inherit',
  860. 'type' => 'option',
  861. 'capability' => 'edit_theme_options',
  862. 'sanitize_callback' => 'et_sanitize_alpha_color',
  863. ));
  864.  
  865. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_secondary_current_item_color', array(
  866. 'label' => esc_html__( 'Top Header Current Page Text Color', 'Divi Hacks' ),
  867. 'section' => 'dh_secondary_menu_options',
  868. 'settings' => 'dh_secondary_current_item_color',
  869. )));
  870.  
  871. $wp_customize->add_setting('dh_secondary_dropdown_width', array(
  872. 'default' => '220px',
  873. 'type' => 'option',
  874. 'capability' => 'edit_theme_options',
  875. ));
  876.  
  877. $wp_customize->add_control('dh_secondary_dropdown_width', array(
  878. 'label' => __('Dropdown Width', 'divi-hacks'),
  879. 'section' => 'dh_secondary_menu_options',
  880. 'type' => 'option',
  881. 'settings' => 'dh_secondary_dropdown_width'
  882. ));
  883.  
  884. $wp_customize->add_setting('dh_secondary_dropdown_line_height', array(
  885. 'default' => '1.2em',
  886. 'type' => 'option',
  887. 'capability' => 'edit_theme_options',
  888. ));
  889.  
  890. $wp_customize->add_control('dh_secondary_dropdown_line_height', array(
  891. 'label' => __('Dropdown Line Height', 'divi-hacks'),
  892. 'section' => 'dh_secondary_menu_options',
  893. 'type' => 'option',
  894. 'settings' => 'dh_secondary_dropdown_line_height'
  895. ));
  896.  
  897. $wp_customize->add_setting( 'dh_secondary_dropdown_link_color', array(
  898. 'default' => 'inherit',
  899. 'type' => 'option',
  900. 'capability' => 'edit_theme_options',
  901. 'sanitize_callback' => 'et_sanitize_alpha_color',
  902. ));
  903.  
  904. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_secondary_dropdown_link_color', array(
  905. 'label' => esc_html__( 'Top Header Dropdown Link Color', 'Divi Hacks' ),
  906. 'section' => 'dh_secondary_menu_options',
  907. 'settings' => 'dh_secondary_dropdown_link_color',
  908. )));
  909.  
  910. $wp_customize->add_setting('dh_secondary_nav_columns_width', array(
  911. 'default' => '120px',
  912. 'type' => 'option',
  913. 'capability' => 'edit_theme_options',
  914. ));
  915.  
  916. $wp_customize->add_control('dh_secondary_nav_columns_width', array(
  917. 'label' => __('Dropdown Column Width', 'divi-hacks'),
  918. 'description' => __('Use this with the <a href="https://divihacks.com/docs/theme-customizations/#columns" target="_blank">Columns in Dropdowns</a> Hack to set the width of the columns.', 'divi-hacks'),
  919. 'section' => 'dh_secondary_menu_options',
  920. 'type' => 'option',
  921. 'settings' => 'dh_secondary_nav_columns_width'
  922. ));
  923.  
  924. $wp_customize->add_setting( 'dh_secondary_nav_columns_text_align', array(
  925. 'capability' => 'edit_theme_options',
  926. 'sanitize_callback' => 'dh_sanitize_select',
  927. 'default' => 'flex-start',
  928. ) );
  929.  
  930. $wp_customize->add_control( 'dh_secondary_nav_columns_text_align', array(
  931. 'type' => 'select',
  932. 'section' => 'dh_secondary_menu_options',
  933. 'label' => __( 'Drop Down Text Alignment' ),
  934. 'choices' => array(
  935. 'flex-start' => __( 'Left' ),
  936. 'center' => __( 'Center' ),
  937. 'flex-end' => __( 'Right' ),
  938. ),
  939. ) );
  940.  
  941. $wp_customize->add_setting('dh_secondary_nav_columns_line_height', array(
  942. 'default' => '2em',
  943. 'type' => 'option',
  944. 'capability' => 'edit_theme_options',
  945. ));
  946.  
  947. $wp_customize->add_control('dh_secondary_nav_columns_line_height', array(
  948. 'label' => __('Dropdown Link Line Height', 'divi-hacks'),
  949. 'section' => 'dh_secondary_menu_options',
  950. 'type' => 'option',
  951. 'settings' => 'dh_secondary_nav_columns_line_height'
  952. ));
  953.  
  954. $wp_customize->add_setting('dh_secondary_nav_columns_left_padding', array(
  955. 'default' => '0px',
  956. 'type' => 'option',
  957. 'capability' => 'edit_theme_options',
  958. ));
  959.  
  960. $wp_customize->add_control('dh_secondary_nav_columns_left_padding', array(
  961. 'label' => __('Column Left Padding', 'divi-hacks'),
  962. 'section' => 'dh_secondary_menu_options',
  963. 'type' => 'option',
  964. 'settings' => 'dh_secondary_nav_columns_left_padding'
  965. ));
  966.  
  967. $wp_customize->add_setting('dh_secondary_nav_columns_right_padding', array(
  968. 'default' => '0px',
  969. 'type' => 'option',
  970. 'capability' => 'edit_theme_options',
  971. ));
  972.  
  973. $wp_customize->add_control('dh_secondary_nav_columns_right_padding', array(
  974. 'label' => __('Column Right Padding', 'divi-hacks'),
  975. 'section' => 'dh_secondary_menu_options',
  976. 'type' => 'option',
  977. 'settings' => 'dh_secondary_nav_columns_right_padding'
  978. ));
  979.  
  980. $wp_customize->add_setting( 'dh_top_header_menu_bar_icon_color', array(
  981. 'default' => 'inherit',
  982. 'type' => 'option',
  983. 'capability' => 'edit_theme_options',
  984. 'sanitize_callback' => 'et_sanitize_alpha_color',
  985. ));
  986.  
  987. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_top_header_menu_bar_icon_color', array(
  988. 'label' => esc_html__( 'Top Header Menu Bar Icon Color', 'Divi Hacks' ),
  989. 'section' => 'dh_secondary_menu_options',
  990. 'settings' => 'dh_top_header_menu_bar_icon_color',
  991. )));
  992. $wp_customize->add_setting( 'dh_top_header_dropdown_icon_color', array(
  993. 'default' => 'inherit',
  994. 'type' => 'option',
  995. 'capability' => 'edit_theme_options',
  996. 'sanitize_callback' => 'et_sanitize_alpha_color',
  997. ));
  998.  
  999. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_top_header_dropdown_icon_color', array(
  1000. 'label' => esc_html__( 'Top Header Dropdown Icon Color', 'Divi Hacks' ),
  1001. 'section' => 'dh_secondary_menu_options',
  1002. 'settings' => 'dh_top_header_dropdown_icon_color',
  1003. )));
  1004.  
  1005. $wp_customize->add_setting('dh_secondary_nav_icon_size', array(
  1006. 'default' => '1em',
  1007. 'type' => 'option',
  1008. 'capability' => 'edit_theme_options',
  1009. ));
  1010.  
  1011. $wp_customize->add_control('dh_secondary_nav_icon_size', array(
  1012. 'label' => __('Secondary Icon Size', 'divi-hacks'),
  1013. 'section' => 'dh_secondary_menu_options',
  1014. 'type' => 'option',
  1015. 'settings' => 'dh_secondary_nav_icon_size'
  1016. ));
  1017.  
  1018. $wp_customize->add_setting('dh_th_dropdown_parent_styles', array(
  1019. 'default' => 'font-weight:bold; text-transform:uppercase; border-bottom:1px solid; padding-bottom:10px; margin-bottom:10px;',
  1020. 'capability' => 'edit_theme_options',
  1021. 'sanitize_callback' => 'sanitize_text_field',
  1022. ));
  1023.  
  1024. $wp_customize->add_control('dh_th_dropdown_parent_styles', array(
  1025. 'label' => __('Top Header Dropdown Column Parent\'s CSS', 'divi-hacks'),
  1026. 'section' => 'dh_secondary_menu_options',
  1027. 'type' => 'textarea',
  1028. 'settings' => 'dh_th_dropdown_parent_styles'
  1029. ));
  1030.  
  1031. $wp_customize->add_setting('dh_th_current_page_styles', array(
  1032. 'default' => '',
  1033. 'capability' => 'edit_theme_options',
  1034. 'sanitize_callback' => 'sanitize_text_field',
  1035. ));
  1036.  
  1037. $wp_customize->add_control('dh_th_current_page_styles', array(
  1038. 'label' => __('Top Header Current Page Link CSS', 'divi-hacks'),
  1039. 'section' => 'dh_secondary_menu_options',
  1040. 'type' => 'textarea',
  1041. 'settings' => 'dh_th_current_page_styles'
  1042. ));
  1043.  
  1044. $wp_customize->add_section('dh_footer_options', array(
  1045. 'priority' => 25,
  1046. 'title' => __('Footer', 'divi-hacks'),
  1047. 'panel' => 'divi_hack_options',
  1048. ));
  1049.  
  1050. $wp_customize->add_setting( 'dh_footer_menu_bar_alignment', array(
  1051. 'capability' => 'edit_theme_options',
  1052. 'sanitize_callback' => 'dh_sanitize_select',
  1053. 'default' => 'left',
  1054. ) );
  1055.  
  1056. $wp_customize->add_control( 'dh_footer_menu_bar_alignment', array(
  1057. 'type' => 'select',
  1058. 'section' => 'dh_footer_options',
  1059. 'label' => __( 'Footer Menu Bar Alignment' ),
  1060. 'choices' => array(
  1061. 'left' => __( 'Left' ),
  1062. 'center' => __( 'Center' ),
  1063. 'right' => __( 'Right' ),
  1064. ),
  1065. ) );
  1066.  
  1067. $wp_customize->add_setting( 'dh_footer_bottom_bar_alignment', array(
  1068. 'capability' => 'edit_theme_options',
  1069. 'sanitize_callback' => 'dh_sanitize_select',
  1070. 'default' => 'default',
  1071. ) );
  1072.  
  1073. $wp_customize->add_control( 'dh_footer_bottom_bar_alignment', array(
  1074. 'type' => 'select',
  1075. 'section' => 'dh_footer_options',
  1076. 'label' => __( 'Footer Bottom Bar Alignment' ),
  1077. 'choices' => array(
  1078. 'default' => __( 'Default' ),
  1079. 'left' => __( 'Left' ),
  1080. 'stacked-center' => __( 'Stacked Center' ),
  1081. 'inline-center' => __( 'Inline Center' ),
  1082. 'right' => __( 'Right' ),
  1083. ),
  1084. ) );
  1085.  
  1086. $wp_customize->add_setting( 'dh_footer_menu_bar_gradient_1', array(
  1087. 'default' => 'rgba(0,0,0,0)',
  1088. 'type' => 'option',
  1089. 'capability' => 'edit_theme_options',
  1090. 'sanitize_callback' => 'et_sanitize_alpha_color',
  1091. ));
  1092.  
  1093. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_footer_menu_bar_gradient_1', array(
  1094. 'label' => esc_html__( 'Footer Menu Bar Gradient Start Color', 'Divi Hacks' ),
  1095. 'section' => 'dh_footer_options',
  1096. 'settings' => 'dh_footer_menu_bar_gradient_1',
  1097. )));
  1098.  
  1099. $wp_customize->add_setting( 'dh_footer_menu_bar_gradient_2', array(
  1100. 'default' => 'rgba(0,0,0,0)',
  1101. 'type' => 'option',
  1102. 'capability' => 'edit_theme_options',
  1103. 'sanitize_callback' => 'et_sanitize_alpha_color',
  1104. ));
  1105.  
  1106. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_footer_menu_bar_gradient_2', array(
  1107. 'label' => esc_html__( 'Footer Menu Bar Gradient End Color', 'Divi Hacks' ),
  1108. 'section' => 'dh_footer_options',
  1109. 'settings' => 'dh_footer_menu_bar_gradient_2',
  1110. )));
  1111.  
  1112. $wp_customize->add_setting( 'dh_footer_menu_bar_gradient_direction', array(
  1113. 'capability' => 'edit_theme_options',
  1114. 'sanitize_callback' => 'dh_sanitize_select',
  1115. 'default' => 'left',
  1116. ) );
  1117.  
  1118. $wp_customize->add_control( 'dh_footer_menu_bar_gradient_direction', array(
  1119. 'type' => 'select',
  1120. 'section' => 'dh_footer_options',
  1121. 'label' => __( 'Footer Menu Bar Gradient Direction' ),
  1122. 'choices' => array(
  1123. 'top' => __( 'Vertical &darr;' ),
  1124. 'left' => __( 'Horizontal &rarr;' ),
  1125. 'topleft' => __( 'Diagonal &#8600;' ),
  1126. 'topright' => __( 'Diagonal &#8601;' ),
  1127. ),
  1128. ) );
  1129.  
  1130. $wp_customize->add_setting( 'dh_footer_bg', array(
  1131. 'default' => '',
  1132. 'type' => 'option',
  1133. 'capability' => 'edit_theme_options',
  1134. ));
  1135.  
  1136. $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'dh_footer_bg', array(
  1137. 'label' => __( 'Footer Background Image', 'Divi Hacks' ),
  1138. 'section' => 'dh_footer_options',
  1139. 'settings' => 'dh_footer_bg',
  1140. )));
  1141.  
  1142. $wp_customize->add_setting('dh_footer_menu_bar_bg_size', array(
  1143. 'default' => 'cover',
  1144. 'type' => 'option',
  1145. 'capability' => 'edit_theme_options',
  1146. ));
  1147.  
  1148. $wp_customize->add_control('dh_footer_menu_bar_bg_size', array(
  1149. 'label' => __('Footer Menu Bar Background Size', 'divi-hacks'),
  1150. 'section' => 'dh_footer_options',
  1151. 'type' => 'option',
  1152. 'settings' => 'dh_footer_menu_bar_bg_size'
  1153. ));
  1154.  
  1155. $wp_customize->add_setting('dh_footer_menu_bar_bg_repeat', array(
  1156. 'default' => 'no-repeat',
  1157. 'type' => 'option',
  1158. 'capability' => 'edit_theme_options',
  1159. ));
  1160.  
  1161. $wp_customize->add_control('dh_footer_menu_bar_bg_repeat', array(
  1162. 'label' => __('Footer Menu Bar Background Repeat', 'divi-hacks'),
  1163. 'section' => 'dh_footer_options',
  1164. 'type' => 'option',
  1165. 'settings' => 'dh_footer_menu_bar_bg_repeat'
  1166. ));
  1167.  
  1168. $wp_customize->add_setting('dh_footer_menu_bar_bg_position', array(
  1169. 'default' => 'center',
  1170. 'type' => 'option',
  1171. 'capability' => 'edit_theme_options',
  1172. ));
  1173.  
  1174. $wp_customize->add_control('dh_footer_menu_bar_bg_position', array(
  1175. 'label' => __('Footer Menu Bar Background Position', 'divi-hacks'),
  1176. 'section' => 'dh_footer_options',
  1177. 'type' => 'option',
  1178. 'settings' => 'dh_footer_menu_bar_bg_position'
  1179. ));
  1180.  
  1181. $wp_customize->add_setting( 'dh_footer_menu_bar_current_item_color', array(
  1182. 'default' => 'inherit',
  1183. 'type' => 'option',
  1184. 'capability' => 'edit_theme_options',
  1185. 'sanitize_callback' => 'et_sanitize_alpha_color',
  1186. ));
  1187.  
  1188. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_footer_menu_bar_current_item_color', array(
  1189. 'label' => esc_html__( 'Footer Menu Bar Current Page Text Color', 'Divi Hacks' ),
  1190. 'section' => 'dh_footer_options',
  1191. 'settings' => 'dh_footer_menu_bar_current_item_color',
  1192. )));
  1193.  
  1194. $wp_customize->add_setting( 'dh_footer_menu_bar_icon_color', array(
  1195. 'default' => 'inherit',
  1196. 'type' => 'option',
  1197. 'capability' => 'edit_theme_options',
  1198. 'sanitize_callback' => 'et_sanitize_alpha_color',
  1199. ));
  1200.  
  1201. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_footer_menu_bar_icon_color', array(
  1202. 'label' => esc_html__( 'Footer Menu Bar Icon Color', 'Divi Hacks' ),
  1203. 'section' => 'dh_footer_options',
  1204. 'settings' => 'dh_footer_menu_bar_icon_color',
  1205. )));
  1206.  
  1207. $wp_customize->add_setting('dh_footer_menu_bar_nav_icon_size', array(
  1208. 'default' => '1em',
  1209. 'type' => 'option',
  1210. 'capability' => 'edit_theme_options',
  1211. ));
  1212.  
  1213. $wp_customize->add_control('dh_footer_menu_bar_nav_icon_size', array(
  1214. 'label' => __('Footer Menu Bar Icon Size', 'divi-hacks'),
  1215. 'section' => 'dh_footer_options',
  1216. 'type' => 'option',
  1217. 'settings' => 'dh_footer_menu_bar_nav_icon_size'
  1218. ));
  1219.  
  1220. $wp_customize->add_section('dh_menu_hover_options', array(
  1221. 'priority' => 15,
  1222. 'title' => __('Menu Hover Options', 'divi-hacks'),
  1223. 'panel' => 'divi_hack_options',
  1224. ));
  1225.  
  1226. $wp_customize->add_setting('dh_mh_hover_styles', array(
  1227. 'default' => 'opacity:1;',
  1228. 'capability' => 'edit_theme_options',
  1229. 'sanitize_callback' => 'sanitize_text_field',
  1230. ));
  1231.  
  1232. $wp_customize->add_control('dh_mh_hover_styles', array(
  1233. 'label' => __('Primary Menu Bar Link Hover CSS', 'divi-hacks'),
  1234. 'section' => 'dh_menu_hover_options',
  1235. 'type' => 'textarea',
  1236. 'settings' => 'dh_mh_hover_styles',
  1237. 'description' => __( 'Will apply to desktop devices only' ),
  1238. ));
  1239.  
  1240. $wp_customize->add_setting('dh_mh_dropdown_hover_styles', array(
  1241. 'default' => 'opacity:1;',
  1242. 'capability' => 'edit_theme_options',
  1243. 'sanitize_callback' => 'sanitize_text_field',
  1244. ));
  1245.  
  1246. $wp_customize->add_control('dh_mh_dropdown_hover_styles', array(
  1247. 'label' => __('Primary Dropdown Link Hover CSS', 'divi-hacks'),
  1248. 'section' => 'dh_menu_hover_options',
  1249. 'type' => 'textarea',
  1250. 'settings' => 'dh_mh_dropdown_hover_styles',
  1251. 'description' => __( 'Will apply to desktop devices only' ),
  1252. ));
  1253.  
  1254. $wp_customize->add_setting('dh_sh_hover_styles', array(
  1255. 'default' => 'opacity:1;',
  1256. 'capability' => 'edit_theme_options',
  1257. 'sanitize_callback' => 'sanitize_text_field',
  1258. ));
  1259.  
  1260. $wp_customize->add_control('dh_sh_hover_styles', array(
  1261. 'label' => __('Secondary Menu Bar Link Hover CSS', 'divi-hacks'),
  1262. 'section' => 'dh_menu_hover_options',
  1263. 'type' => 'textarea',
  1264. 'settings' => 'dh_sh_hover_styles',
  1265. 'description' => __( 'Will apply to desktop devices only' ),
  1266. ));
  1267.  
  1268. $wp_customize->add_setting('dh_sh_dropdown_hover_styles', array(
  1269. 'default' => 'opacity:1;',
  1270. 'capability' => 'edit_theme_options',
  1271. 'sanitize_callback' => 'sanitize_text_field',
  1272. ));
  1273.  
  1274. $wp_customize->add_control('dh_sh_dropdown_hover_styles', array(
  1275. 'label' => __('Secondary Dropdown Link Hover CSS', 'divi-hacks'),
  1276. 'section' => 'dh_menu_hover_options',
  1277. 'type' => 'textarea',
  1278. 'settings' => 'dh_sh_dropdown_hover_styles',
  1279. 'description' => __( 'Will apply to desktop devices only' ),
  1280. ));
  1281.  
  1282. $wp_customize->add_section('miscellaneous', array(
  1283. 'priority' => 25,
  1284. 'title' => __('Miscellaneous', 'divi-hacks'),
  1285. 'panel' => 'divi_hack_options',
  1286. ));
  1287.  
  1288. // Sticky Element Offset Desktop
  1289. $wp_customize->add_setting('dh_sticky_element_offset_desktop', array(
  1290. 'default' => '50',
  1291. 'type' => 'option',
  1292. 'capability' => 'edit_theme_options',
  1293. ));
  1294.  
  1295. $wp_customize->add_control('dh_sticky_element_offset_desktop', array(
  1296. 'label' => __('Sticky Module Offset on Desktop', 'divi-hacks'),
  1297. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1298. 'section' => 'miscellaneous',
  1299. 'type' => 'option',
  1300. 'settings' => 'dh_sticky_element_offset_desktop'
  1301. ));
  1302.  
  1303. // Sticky Row Offset Desktop
  1304. $wp_customize->add_setting('dh_sticky_row_offset_desktop', array(
  1305. 'default' => '50',
  1306. 'type' => 'option',
  1307. 'capability' => 'edit_theme_options',
  1308. ));
  1309.  
  1310. $wp_customize->add_control('dh_sticky_row_offset_desktop', array(
  1311. 'label' => __('Sticky Row Offset on Desktop', 'divi-hacks'),
  1312. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1313. 'section' => 'miscellaneous',
  1314. 'type' => 'option',
  1315. 'settings' => 'dh_sticky_row_offset_desktop'
  1316. ));
  1317.  
  1318. // Sticky Section Offset Desktop
  1319. $wp_customize->add_setting('dh_sticky_section_offset_desktop', array(
  1320. 'default' => '50',
  1321. 'type' => 'option',
  1322. 'capability' => 'edit_theme_options',
  1323. ));
  1324.  
  1325. $wp_customize->add_control('dh_sticky_section_offset_desktop', array(
  1326. 'label' => __('Sticky Section Offset on Desktop', 'divi-hacks'),
  1327. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1328. 'section' => 'miscellaneous',
  1329. 'type' => 'option',
  1330. 'settings' => 'dh_sticky_section_offset_desktop'
  1331. ));
  1332.  
  1333. // Sticky Column Offset Desktop
  1334. $wp_customize->add_setting('dh_sticky_column_offset_desktop', array(
  1335. 'default' => '50',
  1336. 'type' => 'option',
  1337. 'capability' => 'edit_theme_options',
  1338. ));
  1339.  
  1340. $wp_customize->add_control('dh_sticky_column_offset_desktop', array(
  1341. 'label' => __('Sticky Column Offset on Desktop', 'divi-hacks'),
  1342. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1343. 'section' => 'miscellaneous',
  1344. 'type' => 'option',
  1345. 'settings' => 'dh_sticky_column_offset_desktop'
  1346. ));
  1347.  
  1348. // Sticky Element Offset Mobile
  1349. $wp_customize->add_setting('dh_sticky_element_offset_mobile', array(
  1350. 'default' => '50',
  1351. 'type' => 'option',
  1352. 'capability' => 'edit_theme_options',
  1353. ));
  1354.  
  1355. $wp_customize->add_control('dh_sticky_element_offset_mobile', array(
  1356. 'label' => __('Sticky Module Offset on Mobile', 'divi-hacks'),
  1357. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1358. 'section' => 'miscellaneous',
  1359. 'type' => 'option',
  1360. 'settings' => 'dh_sticky_element_offset_mobile'
  1361. ));
  1362.  
  1363. // Sticky Row Offset Mobile
  1364. $wp_customize->add_setting('dh_sticky_row_offset_mobile', array(
  1365. 'default' => '50',
  1366. 'type' => 'option',
  1367. 'capability' => 'edit_theme_options',
  1368. ));
  1369.  
  1370. $wp_customize->add_control('dh_sticky_row_offset_mobile', array(
  1371. 'label' => __('Sticky Row Offset on Mobile', 'divi-hacks'),
  1372. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1373. 'section' => 'miscellaneous',
  1374. 'type' => 'option',
  1375. 'settings' => 'dh_sticky_row_offset_mobile'
  1376. ));
  1377.  
  1378. // Sticky Section Offset Mobile
  1379. $wp_customize->add_setting('dh_sticky_section_offset_mobile', array(
  1380. 'default' => '50',
  1381. 'type' => 'option',
  1382. 'capability' => 'edit_theme_options',
  1383. ));
  1384.  
  1385. $wp_customize->add_control('dh_sticky_section_offset_mobile', array(
  1386. 'label' => __('Sticky Section Offset on Mobile', 'divi-hacks'),
  1387. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1388. 'section' => 'miscellaneous',
  1389. 'type' => 'option',
  1390. 'settings' => 'dh_sticky_section_offset_mobile'
  1391. ));
  1392.  
  1393. // Sticky Column Offset Mobile
  1394. $wp_customize->add_setting('dh_sticky_column_offset_mobile', array(
  1395. 'default' => '50',
  1396. 'type' => 'option',
  1397. 'capability' => 'edit_theme_options',
  1398. ));
  1399.  
  1400. $wp_customize->add_control('dh_sticky_column_offset_mobile', array(
  1401. 'label' => __('Sticky Column Offset on Mobile', 'divi-hacks'),
  1402. 'description' => 'Value is in pixels. Only use numbers. ex. 100',
  1403. 'section' => 'miscellaneous',
  1404. 'type' => 'option',
  1405. 'settings' => 'dh_sticky_column_offset_mobile'
  1406. ));
  1407.  
  1408. $wp_customize->add_setting( 'dh_blurb_11_bg', array(
  1409. 'default' => '#000',
  1410. 'type' => 'option',
  1411. 'capability' => 'edit_theme_options',
  1412. 'sanitize_callback' => 'et_sanitize_alpha_color',
  1413. ));
  1414.  
  1415. $wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'dh_blurb_11_bg', array(
  1416. 'label' => esc_html__( 'Blurb Effect 11 Background', 'Divi Hacks' ),
  1417. 'section' => 'miscellaneous',
  1418. 'settings' => 'dh_blurb_11_bg',
  1419. )));
  1420.  
  1421. $wp_customize->add_section('custom_css_options', array(
  1422. 'priority' => 25,
  1423. 'title' => __('Device Specific CSS', 'divi-hacks'),
  1424. 'panel' => 'divi_hack_options',
  1425. ));
  1426. $wp_customize->add_setting('dh_phone_styles', array(
  1427. 'default' => '',
  1428. 'capability' => 'edit_theme_options',
  1429. 'sanitize_callback' => 'sanitize_text_field',
  1430. ));
  1431.  
  1432. $wp_customize->add_control('dh_phone_styles', array(
  1433. 'label' => __('Phone Styles', 'divi-hacks'),
  1434. 'section' => 'custom_css_options',
  1435. 'type' => 'textarea',
  1436. 'settings' => 'dh_phone_styles'
  1437. ));
  1438.  
  1439. $wp_customize->add_setting('dh_mobile_styles', array(
  1440. 'default' => '',
  1441. 'capability' => 'edit_theme_options',
  1442. 'sanitize_callback' => 'sanitize_text_field',
  1443. ));
  1444.  
  1445. $wp_customize->add_control('dh_mobile_styles', array(
  1446. 'label' => __('Mobile Styles (Tablet & Phone)', 'divi-hacks'),
  1447. 'section' => 'custom_css_options',
  1448. 'type' => 'textarea',
  1449. 'settings' => 'dh_mobile_styles'
  1450. ));
  1451.  
  1452. $wp_customize->add_setting('dh_tablet_styles', array(
  1453. 'default' => '',
  1454. 'capability' => 'edit_theme_options',
  1455. 'sanitize_callback' => 'sanitize_text_field',
  1456. ));
  1457.  
  1458. $wp_customize->add_control('dh_tablet_styles', array(
  1459. 'label' => __('Tablet Styles', 'divi-hacks'),
  1460. 'section' => 'custom_css_options',
  1461. 'type' => 'textarea',
  1462. 'settings' => 'dh_tablet_styles'
  1463. ));
  1464.  
  1465. $wp_customize->add_setting('dh_desktop_styles', array(
  1466. 'default' => '',
  1467. 'capability' => 'edit_theme_options',
  1468. 'sanitize_callback' => 'sanitize_text_field',
  1469. ));
  1470.  
  1471. $wp_customize->add_control('dh_desktop_styles', array(
  1472. 'label' => __('Desktop Styles', 'divi-hacks'),
  1473. 'section' => 'custom_css_options',
  1474. 'type' => 'textarea',
  1475. 'settings' => 'dh_desktop_styles'
  1476. ));
  1477.  
  1478. function dh_sanitize_range( $value ) {
  1479. return (int) $value;
  1480. }
  1481. function dh_sanitize_select( $input, $setting ) {
  1482. // Ensure input is a slug.
  1483. $input = sanitize_key( $input );
  1484.  
  1485. // Get list of choices from the control associated with the setting.
  1486. $choices = $setting->manager->get_control( $setting->id )->choices;
  1487.  
  1488. // If the input is a valid key, return it; otherwise, return the default.
  1489. return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
  1490. }
  1491. }
  1492. // Phone Styles
  1493. add_filter('dh_custom_styles', 'dh_phone_styles');
  1494. function dh_phone_styles() {
  1495. if( get_theme_mod( 'dh_phone_styles') != "" ) {
  1496. echo get_theme_mod( 'dh_phone_styles');
  1497. }
  1498. }
  1499. // Mobile Styles
  1500. add_filter('dh_custom_styles', 'dh_mobile_styles');
  1501. function dh_mobile_styles() {
  1502. if( get_theme_mod( 'dh_mobile_styles') != "" ) {
  1503. echo get_theme_mod( 'dh_mobile_styles');
  1504. }
  1505. }
  1506. // Tablet Styles
  1507. add_filter('dh_custom_styles', 'dh_tablet_styles');
  1508. function dh_tablet_styles() {
  1509. if( get_theme_mod( 'dh_tablet_styles') != "" ) {
  1510. echo get_theme_mod( 'dh_tablet_styles');
  1511. }
  1512. }
  1513. // Desktop Styles
  1514. add_filter('dh_custom_styles', 'dh_desktop_styles');
  1515. function dh_desktop_styles() {
  1516. if( get_theme_mod( 'dh_desktop_styles') != "" ) {
  1517. echo get_theme_mod( 'dh_desktop_styles');
  1518. }
  1519. }
  1520. // Main Header Dropdown Parent Styles
  1521. add_filter('dh_custom_styles', 'dh_mh_dropdown_parent_styles');
  1522. function dh_mh_dropdown_parent_styles() {
  1523. if( get_theme_mod( 'dh_mh_dropdown_parent_styles') != "" ) {
  1524. echo get_theme_mod( 'dh_mh_dropdown_parent_styles');
  1525. }
  1526. }
  1527. // Main Header Dropdown Parent Styles
  1528. add_filter('dh_custom_styles', 'dh_mh_current_page_styles');
  1529. function dh_mh_current_page_styles() {
  1530. if( get_theme_mod( 'dh_mh_current_page_styles') != "" ) {
  1531. echo get_theme_mod( 'dh_mh_current_page_styles');
  1532. }
  1533. }
  1534.  
  1535. // Main Header Link Hover Styles
  1536. add_filter('dh_custom_styles', 'dh_mh_hover_styles');
  1537. function dh_mh_hover_styles() {
  1538. if( get_theme_mod( 'dh_mh_hover_styles') != "" ) {
  1539. echo get_theme_mod( 'dh_mh_hover_styles');
  1540. }
  1541. }
  1542. // Main Header Dropdown Link Hover Styles
  1543. add_filter('dh_custom_styles', 'dh_mh_dropdown_hover_styles');
  1544. function dh_mh_dropdown_hover_styles() {
  1545. if( get_theme_mod( 'dh_mh_dropdown_hover_styles') != "" ) {
  1546. echo get_theme_mod( 'dh_mh_dropdown_hover_styles');
  1547. }
  1548. }
  1549. // Top Header Link Hover Styles
  1550. add_filter('dh_custom_styles', 'dh_sh_hover_styles');
  1551. function dh_sh_hover_styles() {
  1552. if( get_theme_mod( 'dh_sh_hover_styles') != "" ) {
  1553. echo get_theme_mod( 'dh_sh_hover_styles');
  1554. }
  1555. }
  1556. // Top Header Dropdown Link Hover Styles
  1557. add_filter('dh_custom_styles', 'dh_sh_dropdown_hover_styles');
  1558. function dh_sh_dropdown_hover_styles() {
  1559. if( get_theme_mod( 'dh_sh_dropdown_hover_styles') != "" ) {
  1560. echo get_theme_mod( 'dh_sh_dropdown_hover_styles');
  1561. }
  1562. }
  1563. // Top Header Dropdown Parent's Styles
  1564. add_filter('dh_custom_styles', 'dh_th_dropdown_parent_styles');
  1565. function dh_th_dropdown_parent_styles() {
  1566. if( get_theme_mod( 'dh_th_dropdown_parent_styles') != "" ) {
  1567. echo get_theme_mod( 'dh_th_dropdown_parent_styles');
  1568. }
  1569. }
  1570. // Top Header Dropdown Parent's Styles
  1571. add_filter('dh_custom_styles', 'dh_th_current_page_styles');
  1572. function dh_th_current_page_styles() {
  1573. if( get_theme_mod( 'dh_th_current_page_styles') != "" ) {
  1574. echo get_theme_mod( 'dh_th_current_page_styles');
  1575. }
  1576. }
  1577. // Logo Styles
  1578. add_filter('dh_custom_styles', 'dh_logo_styles');
  1579. function dh_logo_styles() {
  1580. if( get_theme_mod( 'dh_logo_styles') != "" ) {
  1581. echo get_theme_mod( 'dh_logo_styles');
  1582. }
  1583. }
  1584.  
  1585. // ------------- Custom Header Styles -------------//
  1586. // H1 Styles
  1587. add_filter('dh_custom_styles', 'dh_custom_h1');
  1588. function dh_custom_h1() {
  1589. if( get_theme_mod( 'dh_custom_h1') != "" ) {
  1590. echo get_theme_mod( 'dh_custom_h1');
  1591. }
  1592. }
  1593. // H2 Styles
  1594. add_filter('dh_custom_styles', 'dh_custom_h2');
  1595. function dh_custom_h2() {
  1596. if( get_theme_mod( 'dh_custom_h2') != "" ) {
  1597. echo get_theme_mod( 'dh_custom_h2');
  1598. }
  1599. }
  1600. // H3 Styles
  1601. add_filter('dh_custom_styles', 'dh_custom_h3');
  1602. function dh_custom_h3() {
  1603. if( get_theme_mod( 'dh_custom_h3') != "" ) {
  1604. echo get_theme_mod( 'dh_custom_h3');
  1605. }
  1606. }
  1607. // H4 Styles
  1608. add_filter('dh_custom_styles', 'dh_custom_h4');
  1609. function dh_custom_h4() {
  1610. if( get_theme_mod( 'dh_custom_h4') != "" ) {
  1611. echo get_theme_mod( 'dh_custom_h4');
  1612. }
  1613. }
  1614. // H5 Styles
  1615. add_filter('dh_custom_styles', 'dh_custom_h5');
  1616. function dh_custom_h5() {
  1617. if( get_theme_mod( 'dh_custom_h5') != "" ) {
  1618. echo get_theme_mod( 'dh_custom_h5');
  1619. }
  1620. }
  1621. // H6 Styles
  1622. add_filter('dh_custom_styles', 'dh_custom_h6');
  1623. function dh_custom_h6() {
  1624. if( get_theme_mod( 'dh_custom_h6') != "" ) {
  1625. echo get_theme_mod( 'dh_custom_h6');
  1626. }
  1627. }
  1628. // H6 Styles
  1629. add_filter('dh_custom_styles', 'dh_import_fonts');
  1630. function dh_import_fonts() {
  1631. if( get_theme_mod( 'dh_import_fonts') != "" ) {
  1632. echo get_theme_mod( 'dh_import_fonts');
  1633. }
  1634. }
  1635.  
  1636. // ------------- Footer Editor -------------//
  1637. function dh_footer_links_editor($wp_customize) {
  1638.  
  1639. // Footer Links Editor Switch
  1640. $wp_customize->add_setting('dh_footer_links_enabler_switch', array(
  1641. 'default' => false,
  1642. 'type' => 'theme_mod',
  1643. 'capability' => 'edit_theme_options',
  1644. ));
  1645. $wp_customize->add_control('dh_footer_links_enabler_switch', array(
  1646. 'label' => __('Enable Custom Footer Links '),
  1647. 'description' => __('Show the Copyright symbol and the current year and add extra links.'),
  1648. 'section' => 'dh_footer_options',
  1649. 'priority' => 20,
  1650. 'type' => 'checkbox',
  1651. 'settings' => 'dh_footer_links_enabler_switch'
  1652. ));
  1653. // Show Current Year & Copyright
  1654. $wp_customize->add_setting( 'dh_footer_links_copyright', array(
  1655. 'capability' => 'edit_theme_options',
  1656. 'sanitize_callback' => 'dh_sanitize_select',
  1657. 'default' => 'inline',
  1658. ) );
  1659.  
  1660. $wp_customize->add_control( 'dh_footer_links_copyright', array(
  1661. 'type' => 'select',
  1662. 'section' => 'dh_footer_options',
  1663. 'label' => __( 'Show/Hide Copyright & Current Year' ),
  1664. 'priority' => 20,
  1665. 'choices' => array(
  1666. 'none' => __( 'Hide Copyright' ),
  1667. 'inline' => __( 'Show Copyright' ),
  1668. ),
  1669. ) );
  1670. // Before Link One
  1671. $wp_customize->add_setting('dh_footer_links_before_link_one', array(
  1672. 'default' => 'All Rights Reserved',
  1673. 'type' => 'option',
  1674. 'capability' => 'edit_theme_options',
  1675. ));
  1676.  
  1677. $wp_customize->add_control('dh_footer_links_before_link_one', array(
  1678. 'label' => __('Text Before First Link', 'divi-hacks'),
  1679. 'section' => 'dh_footer_options',
  1680. 'type' => 'option',
  1681. 'priority' => 25,
  1682. 'settings' => 'dh_footer_links_before_link_one'
  1683. ));
  1684. // Link One
  1685. $wp_customize->add_setting('dh_footer_links_link_one', array(
  1686. 'default' => 'Your Awesome Website',
  1687. 'type' => 'option',
  1688. 'capability' => 'edit_theme_options',
  1689. ));
  1690.  
  1691. $wp_customize->add_control('dh_footer_links_link_one', array(
  1692. 'label' => __('First Link Text', 'divi-hacks'),
  1693. 'section' => 'dh_footer_options',
  1694. 'type' => 'option',
  1695. 'priority' => 30,
  1696. 'settings' => 'dh_footer_links_link_one'
  1697. ));
  1698. // Link One URL
  1699. $wp_customize->add_setting('dh_footer_link_one_url', array(
  1700. 'default' => '#',
  1701. 'type' => 'option',
  1702. 'capability' => 'edit_theme_options',
  1703. ));
  1704.  
  1705. $wp_customize->add_control('dh_footer_link_one_url', array(
  1706. 'label' => __('First Link URL', 'divi-hacks'),
  1707. 'section' => 'dh_footer_options',
  1708. 'type' => 'option',
  1709. 'priority' => 35,
  1710. 'settings' => 'dh_footer_link_one_url'
  1711. ));
  1712. // Link One Open in New Tab
  1713. $wp_customize->add_setting('dh_footer_link_one_open', array(
  1714. 'default' => true,
  1715. 'type' => 'theme_mod',
  1716. 'capability' => 'edit_theme_options',
  1717. ));
  1718. $wp_customize->add_control('dh_footer_link_one_open', array(
  1719. 'label' => __('Open First Link in New Tab?'),
  1720. 'section' => 'dh_footer_options',
  1721. 'type' => 'checkbox',
  1722. 'priority' => 35,
  1723. 'settings' => 'dh_footer_link_one_open'
  1724. ));
  1725.  
  1726. // Footer Divider
  1727. $wp_customize->add_setting('dh_footer_link_divider', array(
  1728. 'default' => '|',
  1729. 'type' => 'option',
  1730. 'capability' => 'edit_theme_options'
  1731. ));
  1732.  
  1733. $wp_customize->add_control('dh_footer_link_divider', array(
  1734. 'label' => __('Footer Link Divider', 'divi-hacks'),
  1735. 'section' => 'dh_footer_options',
  1736. 'type' => 'option',
  1737. 'priority' => 40,
  1738. 'settings' => 'dh_footer_link_divider'
  1739. ));
  1740. // Before Link Two
  1741. $wp_customize->add_setting('dh_footer_links_before_link_two', array(
  1742. 'default' => 'Powered By',
  1743. 'type' => 'option',
  1744. 'capability' => 'edit_theme_options'
  1745. ));
  1746.  
  1747. $wp_customize->add_control('dh_footer_links_before_link_two', array(
  1748. 'label' => __('Text Before Second Link', 'divi-hacks'),
  1749. 'section' => 'dh_footer_options',
  1750. 'type' => 'option',
  1751. 'priority' => 45,
  1752. 'settings' => 'dh_footer_links_before_link_two'
  1753. ));
  1754. // Link Two
  1755. $wp_customize->add_setting('dh_footer_links_link_two', array(
  1756. 'default' => 'Divi Hacks',
  1757. 'type' => 'option',
  1758. 'capability' => 'edit_theme_options'
  1759. ));
  1760.  
  1761. $wp_customize->add_control('dh_footer_links_link_two', array(
  1762. 'label' => __('Second Link Text', 'divi-hacks'),
  1763. 'section' => 'dh_footer_options',
  1764. 'type' => 'option',
  1765. 'priority' => 50,
  1766. 'settings' => 'dh_footer_links_link_two'
  1767. ));
  1768. // Link Two URL
  1769. $wp_customize->add_setting('dh_footer_link_two_url', array(
  1770. 'default' => 'https://divihacks.com',
  1771. 'type' => 'option',
  1772. 'capability' => 'edit_theme_options'
  1773. ));
  1774.  
  1775. $wp_customize->add_control('dh_footer_link_two_url', array(
  1776. 'label' => __('Second Link URL', 'divi-hacks'),
  1777. 'section' => 'dh_footer_options',
  1778. 'type' => 'option',
  1779. 'priority' => 55,
  1780. 'settings' => 'dh_footer_link_two_url'
  1781. ));
  1782. // Link Two Open in New Tab
  1783. $wp_customize->add_setting('dh_footer_link_two_open', array(
  1784. 'default' => true,
  1785. 'type' => 'theme_mod',
  1786. 'capability' => 'edit_theme_options',
  1787. ));
  1788. $wp_customize->add_control('dh_footer_link_two_open', array(
  1789. 'label' => __('Open Second Link in New Tab?'),
  1790. 'section' => 'dh_footer_options',
  1791. 'type' => 'checkbox',
  1792. 'priority' => 55,
  1793. 'settings' => 'dh_footer_link_two_open'
  1794. ));
  1795. }
  1796. add_action('customize_register', 'dh_footer_links_editor');
  1797. function dh_new_bottom_footer() {
  1798. if( false != get_theme_mod( 'dh_footer_links_enabler_switch' ) ) {
  1799. $footer_one = get_option('dh_footer_links_before_link_one','');
  1800. $footer_two = get_option('dh_footer_links_link_one','');
  1801. $footer_link_one = get_option('dh_footer_link_one_url','#');
  1802. $footer_three = get_option('dh_footer_links_before_link_two','Powered By');
  1803. $footer_four = get_option('dh_footer_links_link_two','Divi Hacks');
  1804. $footer_link_two = get_option('dh_footer_link_two_url','https://divihacks.com');
  1805. $footer_divider = get_option('dh_footer_link_divider','|');
  1806. ?>
  1807.  
  1808. <script type="text/javascript">
  1809. jQuery(document).ready(function(){
  1810. jQuery("#footer-info").hide();
  1811. jQuery('<p id="footer-info" class="dh"><span class="dh-footer-copyright">&copy; <?php echo date("Y"); ?> </span><?php echo $footer_one; ?> <a class="fl1" href="<?php echo $footer_link_one; ?>"><?php echo $footer_two; ?></a> <?php echo $footer_divider; ?> <?php echo $footer_three; ?> <a class="fl2" href="<?php echo $footer_link_two; ?>"><?php echo $footer_four; ?></a></p>').insertAfter("#footer-info");
  1812. });
  1813. </script>
  1814.  
  1815. <?php if( false != get_theme_mod( 'dh_footer_link_one_open' ) ) { ?>
  1816. <script type="text/javascript">
  1817. jQuery(document).ready(function($) {
  1818. $('#footer-info.dh a.fl1').attr('target', '_blank');
  1819. });
  1820. </script>
  1821. <?php } if( false != get_theme_mod( 'dh_footer_link_two_open' ) ) { ?>
  1822. <script type="text/javascript">
  1823. jQuery(document).ready(function($) {
  1824. $('#footer-info.dh a.fl2').attr('target', '_blank');
  1825. });
  1826. </script>
  1827. <?php }
  1828. }
  1829. }
  1830. add_action( 'wp_head', 'dh_new_bottom_footer' );
  1831.  
  1832. // ------------- Footer Menu Alignment -------------//
  1833. function dh_footer_menu_alignment() {
  1834. $menu_alignment = get_theme_mod('dh_footer_menu_bar_alignment','left');
  1835. if ( $menu_alignment == 'left' ) { ?>
  1836. <style>
  1837. /** Footer Menu Left Alignment **/
  1838. #main-footer #et-footer-nav ul {
  1839. display: inline-flex;
  1840. justify-content: flex-start;
  1841. width: 100%;
  1842. flex-wrap: wrap;
  1843. }
  1844. </style> <?php
  1845. } if ( $menu_alignment == 'center' ) { ?>
  1846. <style>
  1847. /** Footer Menu Center Alignment **/
  1848. #main-footer #et-footer-nav ul {
  1849. display: inline-flex;
  1850. justify-content: center;
  1851. width: 100%;
  1852. flex-wrap: wrap;
  1853. }
  1854. </style> <?php
  1855. } if ( $menu_alignment == 'right' ) { ?>
  1856. <style>
  1857. /** Footer Menu Right Alignment **/
  1858. #main-footer #et-footer-nav ul {
  1859. display: inline-flex;
  1860. justify-content: flex-end;
  1861. width: 100%;
  1862. flex-wrap: wrap;
  1863. }
  1864. </style> <?php
  1865. }
  1866. }
  1867. add_action( 'wp_head', 'dh_footer_menu_alignment' );
  1868.  
  1869. // ------------- Footer Bottom Alignment -------------//
  1870. function dh_footer_bottom_alignment() {
  1871. $bottom_bar_alignment = get_theme_mod('dh_footer_bottom_bar_alignment','default');
  1872. if ( $bottom_bar_alignment == 'left' ) { ?>
  1873. <style>
  1874. /** Bottom Footer Left Alignment **/
  1875. #footer-bottom .container {
  1876. display: inline-flex;
  1877. flex-direction: row-reverse;
  1878. justify-content: flex-end;
  1879. flex-wrap: wrap;
  1880. }
  1881. </style> <?php
  1882. } if ( $bottom_bar_alignment == 'stacked-center' ) { ?>
  1883. <style>
  1884. /** Bottom Footer Stacked Center Alignment **/
  1885. #footer-bottom .container {
  1886. display: flex;
  1887. flex-direction:column;
  1888. align-items:center;
  1889. flex-wrap: wrap;
  1890. }
  1891. </style> <?php
  1892. } if ( $bottom_bar_alignment == 'inline-center' ) { ?>
  1893. <style>
  1894. /** Bottom Footer Inline Center Alignment **/
  1895. #footer-bottom .container {
  1896. display: inline-flex;
  1897. flex-direction: row-reverse;
  1898. justify-content: center;
  1899. flex-wrap: wrap;
  1900. }
  1901. </style> <?php
  1902. } if ( $bottom_bar_alignment == 'right' ) { ?>
  1903. <style>
  1904. /** Bottom Footer Right Alignment **/
  1905. #footer-bottom .container {
  1906. flex-direction:row-reverse;
  1907. display:flex;
  1908. flex-wrap: wrap;
  1909. }
  1910. </style> <?php
  1911. }
  1912. }
  1913. add_action( 'wp_head', 'dh_footer_bottom_alignment' );
  1914.  
  1915. // ------------- New Mobile Menu -------------//
  1916. function dh_new_mobile_menu() {
  1917. $menu_style = get_theme_mod('dh_custom_mobile_menu','default-mobile-menu');
  1918. if ( $menu_style == 'divi-hacks-mobile-menu-slide-in' ) { ?>
  1919. <script type="text/javascript">
  1920. jQuery(document).ready(function() {
  1921. jQuery('body').addClass('divi-hacks-mobile-menu-slide-in');
  1922. });
  1923. </script> <?php
  1924. }
  1925. if ( $menu_style == 'divi-hacks-mobile-menu-fullscreen' ) { ?>
  1926. <script type="text/javascript">
  1927. jQuery(document).ready(function() {
  1928. jQuery('body').addClass('divi-hacks-mobile-menu-fullscreen');
  1929. });
  1930. </script> <?php
  1931. }
  1932. }
  1933. add_action( 'wp_head', 'dh_new_mobile_menu' );
  1934.  
  1935. // ------------- Animated Menus -------------//
  1936. function dh_animated_menus() {
  1937. $menu_style = get_theme_mod('dh_custom_menu_animations','no-menu-animation');
  1938. if ( $menu_style == 'divi-hacks-animenu-1' ) { ?>
  1939. <script type="text/javascript">
  1940. jQuery(document).ready(function() {
  1941. jQuery('body').addClass('divi-hacks-animenu-1');
  1942. });
  1943. </script> <?php
  1944. } if ( $menu_style == 'divi-hacks-animenu-2' ) { ?>
  1945. <script type="text/javascript">
  1946. jQuery(document).ready(function() {
  1947. jQuery('body').addClass('divi-hacks-animenu-2');
  1948. });
  1949. </script> <?php
  1950. } if ( $menu_style == 'divi-hacks-animenu-3' ) { ?>
  1951. <script type="text/javascript">
  1952. jQuery(document).ready(function() {
  1953. jQuery('body').addClass('divi-hacks-animenu-3');
  1954. });
  1955. </script> <?php
  1956. }
  1957. }
  1958. add_action( 'wp_head', 'dh_animated_menus' );
  1959.  
  1960. // ------------- Custom Header Styles -------------//
  1961. function dh_custom_h_fonts() {
  1962. $custom_heading_fonts = get_theme_mod('dh_custom_heading_fonts','false');
  1963. if ( $custom_heading_fonts == 'true' ) { ?>
  1964. <script type="text/javascript">
  1965. jQuery(document).ready(function() {
  1966. jQuery('body').addClass('divi-hacks-heading-fonts');
  1967. });
  1968. </script> <?php
  1969. }
  1970. }
  1971. add_action( 'wp_head', 'dh_custom_h_fonts' );
  1972.  
  1973. // ------------- Default Menu Hover Styles -------------//
  1974. function dh_default_menu_hover() {
  1975. $nav_disable_menu_hover = get_theme_mod('dh_disable_default_menu_hover','false');
  1976. if ( $nav_disable_menu_hover == 'true' ) { ?>
  1977. <style>
  1978. .et_mobile_menu li a:hover, .nav ul li a:hover, .menu ul li a:hover, #et-info-email:hover, #et-secondary-menu>ul>li>a:hover, #top-menu-nav>ul>li>a:hover, .et-social-icons a:hover {
  1979. opacity: 1 !important;
  1980. background-color: transparent !important;
  1981. }
  1982. </style> <?php
  1983. }
  1984. }
  1985. add_action( 'wp_head', 'dh_default_menu_hover' );
  1986.  
  1987. // ------------- Mobile Menu Background Gradient -------------//
  1988. function dh_mobile_menu_bg_gradient() {
  1989. $dh_mobile_menu_gradient_1 = get_option('dh_mobile_menu_gradient_1','rgba(0,0,0,0)');
  1990. $dh_mobile_menu_gradient_2 = get_option('dh_mobile_menu_gradient_2','rgba(0,0,0,0)');
  1991. $dh_mobile_menu_bg = get_option('dh_mobile_menu_bg','rgba(0,0,0,0.8)');
  1992. $mobile_menu_bg_gradient = get_theme_mod('dh_mobile_menu_gradient_direction','left');
  1993. if ( $mobile_menu_bg_gradient == 'left' ) { ?>
  1994. <style>
  1995. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu,
  1996. .divi-hacks-mobile-menu-slide-in.is-mobile #mobile_menu {
  1997. background: <?php echo $dh_mobile_menu_bg; ?>;
  1998. background: -moz-linear-gradient(left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%, <?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  1999. background: -webkit-linear-gradient(left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2000. background: -ms-linear-gradient(left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2001. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_mobile_menu_gradient_1; ?>', endColorstr='<?php echo $dh_mobile_menu_gradient_2; ?>',GradientType=1 );
  2002. }
  2003. </style> <?php
  2004. } if ( $mobile_menu_bg_gradient == 'top' ) { ?>
  2005. <style>
  2006. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu,
  2007. .divi-hacks-mobile-menu-slide-in.is-mobile #mobile_menu {
  2008. background: <?php echo $dh_mobile_menu_bg; ?>;
  2009. background: -moz-linear-gradient(top, <?php echo $dh_mobile_menu_gradient_1; ?> 0%, <?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2010. background: -webkit-linear-gradient(top, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2011. background: -ms-linear-gradient(top, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2012. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_mobile_menu_gradient_1; ?>', endColorstr='<?php echo $dh_mobile_menu_gradient_2; ?>',GradientType=1 );
  2013. }
  2014. </style> <?php
  2015. } if ( $mobile_menu_bg_gradient == 'topleft' ) { ?>
  2016. <style>
  2017. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu,
  2018. .divi-hacks-mobile-menu-slide-in.is-mobile #mobile_menu {
  2019. background: <?php echo $dh_mobile_menu_bg; ?>;
  2020. background: -moz-linear-gradient(top left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%, <?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2021. background: -webkit-linear-gradient(top left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2022. background: -ms-linear-gradient(top left, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2023. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_mobile_menu_gradient_1; ?>', endColorstr='<?php echo $dh_mobile_menu_gradient_2; ?>',GradientType=1 );
  2024. }
  2025. </style> <?php
  2026. } if ( $mobile_menu_bg_gradient == 'topright' ) { ?>
  2027. <style>
  2028. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu,
  2029. .divi-hacks-mobile-menu-slide-in.is-mobile #mobile_menu {
  2030. background: <?php echo $dh_mobile_menu_bg; ?>;
  2031. background: -moz-linear-gradient(top right, <?php echo $dh_mobile_menu_gradient_1; ?> 0%, <?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2032. background: -webkit-linear-gradient(top right, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2033. background: -ms-linear-gradient(top right, <?php echo $dh_mobile_menu_gradient_1; ?> 0%,<?php echo $dh_mobile_menu_gradient_2; ?> 100%);
  2034. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_mobile_menu_gradient_1; ?>', endColorstr='<?php echo $dh_mobile_menu_gradient_2; ?>',GradientType=1 );
  2035. }
  2036. </style> <?php
  2037. }
  2038. }
  2039. add_action( 'wp_head', 'dh_mobile_menu_bg_gradient' );
  2040.  
  2041. // ------------- Main Header Background Gradient -------------//
  2042. function dh_main_head_bg_gradient() {
  2043. $dh_main_header_gradient_1 = get_option('dh_main_header_gradient_1','rgba(0,0,0,0)');
  2044. $dh_main_header_gradient_2 = get_option('dh_main_header_gradient_2','rgba(0,0,0,0)');
  2045. $main_header_bg_gradient = get_theme_mod('dh_header_gradient_direction','left');
  2046. if ( $main_header_bg_gradient == 'left' ) { ?>
  2047. <style>
  2048. #main-header:before {
  2049. background-image: -moz-linear-gradient(left, <?php echo $dh_main_header_gradient_1; ?> 0%, <?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2050. background: -webkit-linear-gradient(left, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2051. background: -ms-linear-gradient(left, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2052. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_main_header_gradient_1; ?>', endColorstr='<?php echo $dh_main_header_gradient_2; ?>',GradientType=1 ) !important;
  2053. position:absolute;
  2054. top:0;
  2055. bottom:0;
  2056. left:0;
  2057. width:100%;
  2058. height:100%;
  2059. content:'';
  2060. z-index:1;
  2061. }
  2062. </style> <?php
  2063. } if ( $main_header_bg_gradient == 'top' ) { ?>
  2064. <style>
  2065. #main-header:before {
  2066. background-image: -moz-linear-gradient(top, <?php echo $dh_main_header_gradient_1; ?> 0%, <?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2067. background: -webkit-linear-gradient(top, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2068. background: -ms-linear-gradient(top, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2069. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_main_header_gradient_1; ?>', endColorstr='<?php echo $dh_main_header_gradient_2; ?>',GradientType=1 ) !important;
  2070. position:absolute;
  2071. top:0;
  2072. bottom:0;
  2073. left:0;
  2074. width:100%;
  2075. height:100%;
  2076. content:'';
  2077. z-index:1;
  2078. }
  2079. </style> <?php
  2080. } if ( $main_header_bg_gradient == 'topleft' ) { ?>
  2081. <style>
  2082. #main-header:before {
  2083. background-image: -moz-linear-gradient(top left, <?php echo $dh_main_header_gradient_1; ?> 0%, <?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2084. background: -webkit-linear-gradient(top left, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2085. background: -ms-linear-gradient(top left, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2086. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_main_header_gradient_1; ?>', endColorstr='<?php echo $dh_main_header_gradient_2; ?>',GradientType=1 ) !important;
  2087. position:absolute;
  2088. top:0;
  2089. bottom:0;
  2090. left:0;
  2091. width:100%;
  2092. height:100%;
  2093. content:'';
  2094. z-index:1;
  2095. }
  2096. </style> <?php
  2097. } if ( $main_header_bg_gradient == 'topright' ) { ?>
  2098. <style>
  2099. #main-header:before {
  2100. background-image: -moz-linear-gradient(top right, <?php echo $dh_main_header_gradient_1; ?> 0%, <?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2101. background: -webkit-linear-gradient(top right, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2102. background: -ms-linear-gradient(top right, <?php echo $dh_main_header_gradient_1; ?> 0%,<?php echo $dh_main_header_gradient_2; ?> 100%) !important;
  2103. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_main_header_gradient_1; ?>', endColorstr='<?php echo $dh_main_header_gradient_2; ?>',GradientType=1 ) !important;
  2104. position:absolute;
  2105. top:0;
  2106. bottom:0;
  2107. left:0;
  2108. width:100%;
  2109. height:100%;
  2110. content:'';
  2111. z-index:1;
  2112. }
  2113. </style> <?php
  2114. }
  2115. }
  2116. add_action( 'wp_head', 'dh_main_head_bg_gradient' );
  2117.  
  2118. // ------------- Secondary Header Background Gradient -------------//
  2119. function dh_sec_head_bg_gradient() {
  2120. $dh_secondary_header_gradient_1 = get_option('dh_secondary_header_gradient_1','rgba(0,0,0,0)');
  2121. $dh_secondary_header_gradient_2 = get_option('dh_secondary_header_gradient_2','rgba(0,0,0,0)');
  2122. $sec_header_bg_gradient = get_theme_mod('dh_secondary_header_gradient_direction','left');
  2123. if ( $sec_header_bg_gradient == 'left' ) { ?>
  2124. <style>
  2125. #top-header:before {
  2126. background-image: -moz-linear-gradient(left, <?php echo $dh_secondary_header_gradient_1; ?> 0%, <?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2127. background: -webkit-linear-gradient(left, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2128. background: -ms-linear-gradient(left, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2129. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_secondary_header_gradient_1; ?>', endColorstr='<?php echo $dh_secondary_header_gradient_2; ?>',GradientType=1 ) !important;
  2130. position:absolute;
  2131. top:0;
  2132. bottom:0;
  2133. width:100%;
  2134. height:100%;
  2135. content:'';
  2136. z-index:1;
  2137. }
  2138. #top-header .container {
  2139. z-index: 2;
  2140. }
  2141. </style> <?php
  2142. } if ( $sec_header_bg_gradient == 'top' ) { ?>
  2143. <style>
  2144. #top-header:before {
  2145. background-image: -moz-linear-gradient(top, <?php echo $dh_secondary_header_gradient_1; ?> 0%, <?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2146. background: -webkit-linear-gradient(top, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2147. background: -ms-linear-gradient(top, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2148. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_secondary_header_gradient_1; ?>', endColorstr='<?php echo $dh_secondary_header_gradient_2; ?>',GradientType=1 ) !important;
  2149. position:absolute;
  2150. top:0;
  2151. bottom:0;
  2152. width:100%;
  2153. height:100%;
  2154. content:'';
  2155. z-index:1;
  2156. }
  2157. #top-header .container {
  2158. z-index: 2;
  2159. }
  2160. </style> <?php
  2161. } if ( $sec_header_bg_gradient == 'topleft' ) { ?>
  2162. <style>
  2163. #top-header:before {
  2164. background-image: -moz-linear-gradient(top left, <?php echo $dh_secondary_header_gradient_1; ?> 0%, <?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2165. background: -webkit-linear-gradient(top left, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2166. background: -ms-linear-gradient(top left, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2167. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_secondary_header_gradient_1; ?>', endColorstr='<?php echo $dh_secondary_header_gradient_2; ?>',GradientType=1 ) !important;
  2168. position:absolute;
  2169. top:0;
  2170. bottom:0;
  2171. width:100%;
  2172. height:100%;
  2173. content:'';
  2174. z-index:1;
  2175. }
  2176. #top-header .container {
  2177. z-index: 2;
  2178. }
  2179. </style> <?php
  2180. } if ( $sec_header_bg_gradient == 'topright' ) { ?>
  2181. <style>
  2182. #top-header:before {
  2183. background-image: -moz-linear-gradient(top right, <?php echo $dh_secondary_header_gradient_1; ?> 0%, <?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2184. background: -webkit-linear-gradient(top right, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2185. background: -ms-linear-gradient(top right, <?php echo $dh_secondary_header_gradient_1; ?> 0%,<?php echo $dh_secondary_header_gradient_2; ?> 100%) !important;
  2186. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_secondary_header_gradient_1; ?>', endColorstr='<?php echo $dh_secondary_header_gradient_2; ?>',GradientType=1 ) !important;
  2187. position:absolute;
  2188. top:0;
  2189. bottom:0;
  2190. width:100%;
  2191. height:100%;
  2192. content:'';
  2193. z-index:1;
  2194. }
  2195. #top-header .container {
  2196. z-index: 2;
  2197. }
  2198. </style> <?php
  2199. }
  2200. }
  2201. add_action( 'wp_head', 'dh_sec_head_bg_gradient' );
  2202.  
  2203. // ------------- Footer Background Gradient -------------//
  2204. function dh_footer_bg_gradient() {
  2205. $dh_footer_menu_bar_gradient_1 = get_option('dh_footer_menu_bar_gradient_1','rgba(0,0,0,0)');
  2206. $dh_footer_menu_bar_gradient_2 = get_option('dh_footer_menu_bar_gradient_2','rgba(0,0,0,0)');
  2207. $footer_bg_gradient = get_theme_mod('dh_footer_menu_bar_gradient_direction','left');
  2208. if ( $footer_bg_gradient == 'left' ) { ?>
  2209. <style>
  2210. #main-footer:before {
  2211. background-image: -moz-linear-gradient(left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%, <?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2212. background: -webkit-linear-gradient(left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2213. background: -ms-linear-gradient(left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2214. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_footer_menu_bar_gradient_1; ?>', endColorstr='<?php echo $dh_footer_menu_bar_gradient_2; ?>',GradientType=1 ) !important;
  2215. position:absolute;
  2216. top:0;
  2217. bottom:0;
  2218. left:0;
  2219. width:100%;
  2220. height:100%;
  2221. content:'';
  2222. z-index:1;
  2223. }
  2224. #main-footer {
  2225. position:relative;
  2226. }
  2227. #main-footer .container {
  2228. z-index: 2;
  2229. }
  2230. </style> <?php
  2231. } if ( $footer_bg_gradient == 'top' ) { ?>
  2232. <style>
  2233. #main-footer:before {
  2234. background-image: -moz-linear-gradient(top, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%, <?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2235. background: -webkit-linear-gradient(top, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2236. background: -ms-linear-gradient(top, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2237. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_footer_menu_bar_gradient_1; ?>', endColorstr='<?php echo $dh_footer_menu_bar_gradient_2; ?>',GradientType=1 ) !important;
  2238. position:absolute;
  2239. top:0;
  2240. bottom:0;
  2241. left:0;
  2242. width:100%;
  2243. height:100%;
  2244. content:'';
  2245. z-index:1;
  2246. }
  2247. #main-footer {
  2248. position:relative;
  2249. }
  2250. #main-footer .container {
  2251. z-index: 2;
  2252. }
  2253. </style> <?php
  2254. } if ( $footer_bg_gradient == 'topleft' ) { ?>
  2255. <style>
  2256. #main-footer:before {
  2257. background-image: -moz-linear-gradient(top left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%, <?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2258. background: -webkit-linear-gradient(top left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2259. background: -ms-linear-gradient(top left, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2260. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_footer_menu_bar_gradient_1; ?>', endColorstr='<?php echo $dh_footer_menu_bar_gradient_2; ?>',GradientType=1 ) !important;
  2261. position:absolute;
  2262. top:0;
  2263. bottom:0;
  2264. left:0;
  2265. width:100%;
  2266. height:100%;
  2267. content:'';
  2268. z-index:1;
  2269. }
  2270. #main-footer {
  2271. position:relative;
  2272. }
  2273. #main-footer .container {
  2274. z-index: 2;
  2275. }
  2276. </style> <?php
  2277. } if ( $footer_bg_gradient == 'topright' ) { ?>
  2278. <style>
  2279. #main-footer:before {
  2280. background-image: -moz-linear-gradient(top right, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%, <?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2281. background: -webkit-linear-gradient(top right, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2282. background: -ms-linear-gradient(top right, <?php echo $dh_footer_menu_bar_gradient_1; ?> 0%,<?php echo $dh_footer_menu_bar_gradient_2; ?> 100%) !important;
  2283. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $dh_footer_menu_bar_gradient_1; ?>', endColorstr='<?php echo $dh_footer_menu_bar_gradient_2; ?>',GradientType=1 ) !important;
  2284. position:absolute;
  2285. top:0;
  2286. bottom:0;
  2287. left:0;
  2288. width:100%;
  2289. height:100%;
  2290. content:'';
  2291. z-index:1;
  2292. }
  2293. #main-footer {
  2294. position:relative;
  2295. }
  2296. #main-footer .container {
  2297. z-index: 2;
  2298. }
  2299. </style> <?php
  2300. }
  2301. }
  2302. add_action( 'wp_head', 'dh_footer_bg_gradient' );
  2303.  
  2304. function dh_switch_customizer_css(){
  2305.  
  2306. $dh_footer_bg = get_option('dh_footer_bg','');
  2307. $dh_mobile_menu_text = get_option('dh_mobile_menu_text','#ffffff');
  2308. $dh_mobile_open_toggle_icon = get_option('dh_mobile_open_toggle_icon','#1b1d1e');
  2309. $dh_mobile_closed_toggle_icon = get_option('dh_mobile_closed_toggle_icon','#1b1d1e');
  2310. $dh_mobile_cart_icon = get_option('dh_mobile_cart_icon','#1b1d1e');
  2311. $dh_mobile_menu_current = get_option('dh_mobile_menu_current','#247BA0');
  2312. $dh_mobile_submenu_bg_color = get_option('dh_mobile_submenu_bg_color','rgba(0,0,0,0.1)');
  2313. $dh_mobile_menu_letter_spacing = get_option('dh_mobile_menu_letter_spacing','2');
  2314. $dh_mobile_menu_line_height = get_option('dh_mobile_menu_line_height','1em');
  2315. $dh_mobile_menu_submenu_line_height = get_option('dh_mobile_menu_submenu_line_height','1em');
  2316. $dh_header_bg = get_option('dh_header_bg','');
  2317. $dh_main_header_bg_size = get_option('dh_main_header_bg_size','cover');
  2318. $dh_main_header_bg_repeat = get_option('dh_main_header_bg_repeat','no-repeat');
  2319. $dh_main_header_bg_position = get_option('dh_main_header_bg_position','center');
  2320. $dh_nav_columns_width = get_option('dh_nav_columns_width','120px');
  2321. $dh_nav_columns_line_height = get_option('dh_nav_columns_line_height','2em');
  2322. $dh_nav_columns_left_padding = get_option('dh_nav_columns_left_padding','0px');
  2323. $dh_nav_columns_right_padding = get_option('dh_nav_columns_right_padding','0px');
  2324. $dh_primary_dropdown_link_color = get_option('dh_primary_dropdown_link_color', 'inherit');
  2325. $dh_primary_dropdown_line_height = get_option('dh_primary_dropdown_line_height', '1.2em');
  2326. $dh_primary_dropdown_width = get_option('dh_primary_dropdown_width', '240px');
  2327. $dh_secondary_dropdown_link_color = get_option('dh_psecondary_dropdown_link_color', 'inherit');
  2328. $dh_secondary_dropdown_line_height = get_option('dh_secondary_dropdown_line_height', '1.2em');
  2329. $dh_secondary_dropdown_width = get_option('dh_secondary_dropdown_width', '220px');
  2330. $dh_secondary_header_bg = get_option('dh_secondary_header_bg','');
  2331. $dh_secondary_header_bg_size = get_option('dh_secondary_header_bg_size','cover');
  2332. $dh_secondary_header_bg_repeat = get_option('dh_secondary_header_bg_repeat','no-repeat');
  2333. $dh_secondary_header_bg_position = get_option('dh_secondary_header_bg_position','center');
  2334. $dh_secondary_nav_columns_width = get_option('dh_secondary_nav_columns_width','120px');
  2335. $dh_secondary_nav_columns_line_height = get_option('dh_secondary_nav_columns_line_height','2em');
  2336. $dh_secondary_nav_columns_line_height = get_option('dh_secondary_nav_columns_line_height','2em');
  2337. $dh_secondary_nav_columns_left_padding = get_option('dh_secondary_nav_columns_left_padding','0px');
  2338. $dh_secondary_nav_columns_right_padding = get_option('dh_secondary_nav_columns_right_padding','0px');
  2339. $dh_secondary_current_item_color = get_option('dh_secondary_current_item_color','inherit');
  2340. $dh_top_icon_color = get_option('dh_top_icon_color','inherit');
  2341. $dh_dropdown_icon_color = get_option('dh_dropdown_icon_color','inherit');
  2342. $dh_top_header_menu_bar_icon_color = get_option('dh_top_header_menu_bar_icon_color','inherit');
  2343. $dh_top_header_dropdown_icon_color = get_option('dh_top_header_dropdown_icon_color','inherit');
  2344. $dh_nav_icon_size = get_option('dh_nav_icon_size','1em');
  2345. $dh_secondary_nav_icon_size = get_option('dh_secondary_nav_icon_size','1em');
  2346. $dh_h1_color = get_option('dh_h1_color','inherit');
  2347. $dh_h2_color = get_option('dh_h2_color','inherit');
  2348. $dh_h3_color = get_option('dh_h3_color','inherit');
  2349. $dh_h4_color = get_option('dh_h4_color','inherit');
  2350. $dh_h5_color = get_option('dh_h5_color','inherit');
  2351. $dh_h6_color = get_option('dh_h6_color','inherit');
  2352. $dh_menu_animation_accent_color = get_option('dh_menu_animation_accent_color','inherit');
  2353. $dh_footer_menu_bar_bg = get_option('dh_footer_menu_bar_bg','');
  2354. $dh_footer_menu_bar_bg_size = get_option('dh_footer_menu_bar_bg_size','cover');
  2355. $dh_footer_menu_bar_bg_repeat = get_option('dh_footer_menu_bar_bg_repeat','no-repeat');
  2356. $dh_footer_menu_bar_bg_position = get_option('dh_footer_menu_bar_bg_position','center');
  2357. $dh_footer_menu_bar_nav_icon_size = get_option('dh_footer_menu_bar_nav_icon_size','1em');
  2358. $dh_footer_menu_bar_icon_color = get_option('dh_footer_menu_bar_icon_color','inherit');
  2359. $dh_footer_menu_bar_current_item_color = get_option('dh_footer_menu_bar_current_item_color','inherit');
  2360. $dh_sticky_element_offset_desktop = get_option('dh_sticky_element_offset_desktop','50');
  2361. $dh_sticky_row_offset_desktop = get_option('dh_sticky_row_offset_desktop','50');
  2362. $dh_sticky_section_offset_desktop = get_option('dh_sticky_section_offset_desktop','50');
  2363. $dh_sticky_column_offset_desktop = get_option('dh_sticky_column_offset_desktop','50');
  2364. $dh_sticky_element_offset_mobile = get_option('dh_sticky_element_offset_mobile','50');
  2365. $dh_sticky_row_offset_mobile = get_option('dh_sticky_row_offset_mobile','50');
  2366. $dh_sticky_section_offset_mobile = get_option('dh_sticky_section_offset_mobile','50');
  2367. $dh_sticky_column_offset_mobile = get_option('dh_sticky_column_offset_mobile','50');
  2368. ?>
  2369.  
  2370. <script type="text/javascript">
  2371. jQuery(document).ready(function($) {
  2372. $('div:not(.et_mobile_menu) .lightbox-content, div:not(.et_mobile_menu) [class*="lightbox-content-"]').addClass('mfp-hide');
  2373. $('div:not(.et_mobile_menu) .lightbox-trigger').magnificPopup({ items: { src: 'div:not(.et_mobile_menu) .lightbox-content', type: 'inline' } });
  2374. $('div:not(.et_mobile_menu) [class*="lightbox-trigger-"]').each(function(){
  2375. var triggerClass = Array.prototype.find.call(this.classList, function(clazz){
  2376. return clazz.indexOf('lightbox-trigger-') > -1;
  2377. });
  2378. var suffix = triggerClass.split('lightbox-trigger-')[1];
  2379. var content = '.lightbox-content-'+ suffix;
  2380. $(this).magnificPopup({ items: { src: content, type: 'inline' } });
  2381. });
  2382. $('[class*="lightbox-content"]').prepend('<div class="lightbox-overlay"></div>');
  2383. $('.lightbox-overlay, .mfp-close').click(function() {
  2384. $("[class*='lightbox-content'].et_pb_video.autoplay iframe").each(function(){
  2385. var removeautoplay = $(this).attr("src").replace("&autoplay=1", "");
  2386. $(this).attr("src",removeautoplay);
  2387. });
  2388. $.magnificPopup.close();
  2389. });
  2390.  
  2391. function myFunction(stickydesktop) {
  2392. if (stickydesktop.matches) { // If media query matches
  2393. $(".divi-hacks-sticky:not(.admin-bar) .sticky-module, .divi-hacks-sticky.admin-bar.divi-hacks-autohide-admin-bar .sticky-module").stick_in_parent({parent:'.et_pb_row', offset_top:<?php echo $dh_sticky_element_offset_desktop; ?>});
  2394. $(".divi-hacks-sticky.admin-bar:not(.divi-hacks-autohide-admin-bar) .sticky-module").stick_in_parent({parent:'.et_pb_row', offset_top:<?php echo $dh_sticky_element_offset_desktop; ?> + 32});
  2395. $(".sticky-row").parent(".et_pb_section").addClass("has-sticky-row");
  2396. $(".divi-hacks-sticky:not(.admin-bar) .sticky-row, .divi-hacks-sticky.admin-bar.divi-hacks-autohide-admin-bar .sticky-row").stick_in_parent({offset_top:<?php echo $dh_sticky_row_offset_desktop; ?>});
  2397. $(".divi-hacks-sticky.admin-bar:not(.divi-hacks-autohide-admin-bar) .sticky-row").stick_in_parent({offset_top:<?php echo $dh_sticky_row_offset_desktop; ?> + 32});
  2398. $(".divi-hacks-sticky:not(.admin-bar) .sticky-section, .divi-hacks-sticky.admin-bar.divi-hacks-autohide-admin-bar .sticky-section").stick_in_parent({offset_top:<?php echo $dh_sticky_section_offset_desktop; ?>});
  2399. $(".divi-hacks-sticky.admin-bar:not(.divi-hacks-autohide-admin-bar) .sticky-section").stick_in_parent({offset_top:<?php echo $dh_sticky_section_offset_desktop; ?> + 32});
  2400. $(".sticky-column").wrapInner("<div class='sticky-column-wrapper'></div>");
  2401. $(".divi-hacks-sticky:not(.admin-bar) .sticky-column .sticky-column-wrapper, .divi-hacks-sticky.admin-bar.divi-hacks-autohide-admin-bar .sticky-column .sticky-column-wrapper").stick_in_parent({parent:'.et_pb_row',offset_top:<?php echo $dh_sticky_column_offset_desktop; ?>});
  2402. $(".divi-hacks-sticky.admin-bar:not(.divi-hacks-autohide-admin-bar) .sticky-column .sticky-column-wrapper").stick_in_parent({parent:'.et_pb_row',offset_top:<?php echo $dh_sticky_column_offset_desktop; ?> + 32});
  2403. } else {
  2404. $(".sticky-row").parent(".et_pb_section").addClass("has-sticky-row");
  2405. $(".sticky-column").parent(".et_pb_row").addClass("has-sticky-column");
  2406. $(".divi-hacks-sticky:not(.admin-bar) .sticky-module").stick_in_parent({parent:'.et_pb_row', offset_top:<?php echo $dh_sticky_element_offset_mobile; ?>});
  2407. $(".divi-hacks-sticky.admin-bar .sticky-module").stick_in_parent({parent:'.et_pb_row', offset_top:<?php echo $dh_sticky_element_offset_mobile; ?> + 32});
  2408. $(".divi-hacks-sticky:not(.admin-bar) .sticky-row").stick_in_parent({offset_top:<?php echo $dh_sticky_row_offset_mobile; ?>});
  2409. $(".divi-hacks-sticky.admin-bar .sticky-row").stick_in_parent({offset_top:<?php echo $dh_sticky_row_offset_mobile; ?> + 32});
  2410. $(".divi-hacks-sticky:not(.admin-bar) .sticky-section").stick_in_parent({offset_top:<?php echo $dh_sticky_section_offset_mobile; ?>});
  2411. $(".divi-hacks-sticky.admin-bar .sticky-section").stick_in_parent({offset_top:<?php echo $dh_sticky_section_offset_mobile; ?>});
  2412. $(".sticky-column").wrapInner("<div class='sticky-column-wrapper'></div>");
  2413. $(".divi-hacks-sticky:not(.admin-bar) .sticky-column .sticky-column-wrapper").stick_in_parent({parent:'.et_pb_row',offset_top:<?php echo $dh_sticky_column_offset_mobile; ?>});
  2414. $(".divi-hacks-sticky.admin-bar .sticky-column .sticky-column-wrapper").stick_in_parent({parent:'.et_pb_row',offset_top:<?php echo $dh_sticky_column_offset_mobile; ?> + 32});
  2415. $('.sticky-module').closest('.et_pb_row').css('flex-direction', 'column');
  2416.  
  2417. }
  2418. }
  2419. var stickydesktop = window.matchMedia("(min-width: 981px)")
  2420. myFunction(stickydesktop) // Call listener function at run time
  2421. stickydesktop.addListener(myFunction) // Attach listener function on state changes
  2422. });
  2423. </script>
  2424. <style id="divi-hack">
  2425. /** @import Custom Fonts - Keep at top of this style **/
  2426. <?php echo get_theme_mod( 'dh_import_fonts'); ?>
  2427.  
  2428. /** Body Overall Font Weight **/
  2429. body {
  2430. font-weight: <?php echo get_theme_mod("dh_body_font_weight"); ?>
  2431. }
  2432. /** Menu Animation Accent Color **/
  2433. .divi-hacks-animenu-1 #top-menu > li:before,
  2434. .divi-hacks-animenu-2 #top-menu li.current_page_item > a,
  2435. .divi-hacks-animenu-2 .et-fixed-header #top-menu li.current_page_item > a,
  2436. .divi-hacks-animenu-3 #top-menu > li.page_item::before {
  2437. border-color: <?php echo $dh_menu_animation_accent_color; ?>;
  2438. }
  2439. .divi-hacks-animenu-2 #top-menu li:not(.menu-item-has-children):not(.current_page_item):hover a {
  2440. box-shadow:0px 5px 0px 0px <?php echo $dh_menu_animation_accent_color; ?>;
  2441. }
  2442. /** Main Header Menu Bar Link Hover Styles **/
  2443. .is-desktop #main-header #top-menu > li > a:hover {
  2444. <?php echo get_theme_mod( 'dh_mh_hover_styles'); ?>
  2445. }
  2446. /** Main Header Dropdown Link Hover Styles **/
  2447. .is-desktop #main-header #top-menu > li:not(.module-in-menu) > ul > li a:hover {
  2448. <?php echo get_theme_mod( 'dh_mh_dropdown_hover_styles'); ?>
  2449. }
  2450. /** Top Header Menu Bar Link Hover Styles **/
  2451. .is-desktop #top-header #et-secondary-nav > li > a:hover {
  2452. <?php echo get_theme_mod( 'dh_sh_hover_styles'); ?>
  2453. }
  2454. /** Top Header Dropdown Link Hover Styles **/
  2455. .is-desktop #top-header #et-secondary-nav > li:not(.module-in-menu) > ul > li a:hover {
  2456. <?php echo get_theme_mod( 'dh_sh_dropdown_hover_styles'); ?>
  2457. }
  2458. /** Custom Heading Font Family **/
  2459. .divi-hacks-heading-fonts h1, .divi-hacks-heading-fonts h1 a {
  2460. color: <?php echo $dh_h1_color; ?>;
  2461. <?php echo get_theme_mod( 'dh_custom_h1'); ?>
  2462. }
  2463. .divi-hacks-heading-fonts h2, .divi-hacks-heading-fonts h2 a {
  2464. color: <?php echo $dh_h2_color; ?>;
  2465. <?php echo get_theme_mod( 'dh_custom_h2'); ?>
  2466. }
  2467. .divi-hacks-heading-fonts div:not(.et-fb-form__toggle-title):not(.et-fb-module-settings):not(.et-fb-export-file-name-field):not(.et-fb-upload-file-container):not(.et-fb-import-options-field):not(. et-core-modal-header):not(.et_pb_gallery_title) > h3, .divi-hacks-heading-fonts h3 a {
  2468. color: <?php echo $dh_h3_color; ?>;
  2469. <?php echo get_theme_mod( 'dh_custom_h3'); ?>
  2470. }
  2471. .divi-hacks-heading-fonts h4, .divi-hacks-heading-fonts h4 a {
  2472. color: <?php echo $dh_h4_color; ?>;
  2473. <?php echo get_theme_mod( 'dh_custom_h4'); ?>
  2474. }
  2475. .divi-hacks-heading-fonts h5, .divi-hacks-heading-fonts h5 a {
  2476. color: <?php echo $dh_h5_color; ?>;
  2477. <?php echo get_theme_mod( 'dh_custom_h5'); ?>
  2478. }
  2479. .divi-hacks-heading-fonts h6, .divi-hacks-heading-fonts h6 a {
  2480. color: <?php echo $dh_h6_color; ?>;
  2481. <?php echo get_theme_mod( 'dh_custom_h6'); ?>
  2482. }
  2483. /** Logo Styles **/
  2484. #logo {
  2485. <?php echo get_theme_mod( 'dh_logo_styles'); ?>
  2486. }
  2487. /** Primary Nav Font Awesome Icon Size **/
  2488. .divi-hacks-font-awesome-icons #main-header .fab > a:before,
  2489. .divi-hacks-font-awesome-icons #main-header .far > a:before,
  2490. .divi-hacks-font-awesome-icons #main-header .fas > a:before,
  2491. .divi-hacks-font-awesome-icons #main-header .fal > a:before,
  2492. .divi-hacks-font-awesome-icons #main-header .fa > a:before {
  2493. font-size: <?php echo $dh_nav_icon_size; ?>
  2494. }
  2495. /** Secondary Nav Font Awesome Icon Size **/
  2496. .divi-hacks-font-awesome-icons #et-secondary-nav .fab > a:before,
  2497. .divi-hacks-font-awesome-icons #et-secondary-nav .far > a:before,
  2498. .divi-hacks-font-awesome-icons #et-secondary-nav .fas > a:before,
  2499. .divi-hacks-font-awesome-icons #et-secondary-nav .fal > a:before,
  2500. .divi-hacks-font-awesome-icons #et-secondary-nav .fa > a:before {
  2501. font-size: <?php echo $dh_secondary_nav_icon_size; ?>
  2502. }
  2503. /** Nav Font Awesome Icon colors **/
  2504. .divi-hacks-font-awesome-icons .fa > a:before,
  2505. .divi-hacks-font-awesome-icons .fas > a:before,
  2506. .divi-hacks-font-awesome-icons .far > a:before,
  2507. .divi-hacks-font-awesome-icons .fab > a:before,
  2508. .divi-hacks-font-awesome-icons .fal > a:before {
  2509. color: <?php echo $dh_top_icon_color; ?>;
  2510. }
  2511. .divi-hacks-font-awesome-icons .sub-menu .fa > a:before,
  2512. .divi-hacks-font-awesome-icons .sub-menu .fas > a:before,
  2513. .divi-hacks-font-awesome-icons .sub-menu .far > a:before,
  2514. .divi-hacks-font-awesome-icons .sub-menu .fab > a:before,
  2515. .divi-hacks-font-awesome-icons .sub-menu .fal > a:before {
  2516. color: <?php echo $dh_dropdown_icon_color; ?>;
  2517. align-self: center;
  2518. }
  2519. .divi-hacks-font-awesome-icons #et-secondary-nav .fa > a:before,
  2520. .divi-hacks-font-awesome-icons #et-secondary-nav .fas > a:before,
  2521. .divi-hacks-font-awesome-icons #et-secondary-nav .far > a:before,
  2522. .divi-hacks-font-awesome-icons #et-secondary-nav .fab > a:before,
  2523. .divi-hacks-font-awesome-icons #et-secondary-nav .fal > a:before {
  2524. color: <?php echo $dh_top_header_menu_bar_icon_color; ?>;
  2525. }
  2526. .divi-hacks-font-awesome-icons #et-secondary-nav .sub-menu .fa > a:before,
  2527. .divi-hacks-font-awesome-icons #et-secondary-nav .sub-menu .fas > a:before,
  2528. .divi-hacks-font-awesome-icons #et-secondary-nav .sub-menu .far > a:before,
  2529. .divi-hacks-font-awesome-icons #et-secondary-nav .sub-menu .fab > a:before,
  2530. .divi-hacks-font-awesome-icons #et-secondary-nav .sub-menu .fal > a:before {
  2531. color: <?php echo $dh_top_header_dropdown_icon_color; ?>;
  2532. }
  2533.  
  2534. /** Primary Nav Dropdown Column Left & Right Padding **/
  2535. .is-desktop.divi-hacks-nav-columns #top-menu > li.nav-columns:not(.module-in-menu) > ul > li {
  2536. padding-left: <?php echo $dh_nav_columns_left_padding; ?> !important;
  2537. padding-right: <?php echo $dh_nav_columns_right_padding; ?> !important;
  2538. }
  2539. /** Secondary Nav Dropdown Column Left & Right Padding **/
  2540. .is-desktop.divi-hacks-nav-columns #et-secondary-nav > li.nav-columns:not(.module-in-menu) > ul > li {
  2541. padding-left: <?php echo $dh_secondary_nav_columns_left_padding; ?> !important;
  2542. padding-right: <?php echo $dh_secondary_nav_columns_right_padding; ?> !important;
  2543. }
  2544. /** Primary Dropdown Child Elements Line Height **/
  2545. .divi-hacks-nav-columns.is-desktop li.nav-columns:not(.module-in-menu) ul li a,
  2546. .divi-hacks-nav-columns.is-desktop #main-header .nav li ul li a {
  2547. line-height: <?php echo $dh_nav_columns_line_height; ?>;
  2548. }
  2549. /** Secondary Nav Dropdown Child Elements Line Height **/
  2550. .divi-hacks-nav-columns.is-desktop #et-secondary-nav.menu li:not(.module-in-menu) ul li a {
  2551. line-height: <?php echo $dh_secondary_nav_columns_line_height; ?>;
  2552. }
  2553. /** Primary Nav Dropdown Text Align **/
  2554. .is-desktop li.nav-columns:not(.module-in-menu) ul li a,
  2555. .is-desktop #main-header .nav li:not(.module-in-menu) ul li a {
  2556. justify-content: <?php echo get_theme_mod("dh_nav_columns_text_align"); ?>;
  2557. }
  2558. /** Secondary Nav Dropdown Text Align **/
  2559. .is-desktop #et-secondary-nav.menu li:not(.module-in-menu) ul li a {
  2560. display: -webkit-box;
  2561. display: -moz-box;
  2562. display: -ms-flexbox;
  2563. display: -webkit-flex;
  2564. display: flex;
  2565. justify-content: <?php echo get_theme_mod("dh_secondary_nav_columns_text_align"); ?>;
  2566. }
  2567. /** Secondary Nav Current Page Item Text Color **/
  2568. #et-secondary-nav li.current_page_item > a,
  2569. #et-secondary-nav li.current-menu-item > a:before {
  2570. color: <?php echo $dh_secondary_current_item_color; ?> !important;
  2571. }
  2572. /** Main Header Nav Dropdown Parent Styles **/
  2573. .divi-hacks-nav-columns.is-desktop #main-header li.nav-columns:not(.module-in-menu) > ul > li > a {
  2574. <?php echo get_theme_mod( 'dh_mh_dropdown_parent_styles'); ?>
  2575. }
  2576. /** Top Header Nav Dropdown Parent Styles **/
  2577. .divi-hacks-nav-columns.is-desktop #et-secondary-nav li.nav-columns:not(.module-in-menu) > ul > li > a {
  2578. <?php echo get_theme_mod( 'dh_th_dropdown_parent_styles'); ?>
  2579. }
  2580. /** Main Header Current Item Styles **/
  2581. #main-header li.current_page_item > a {
  2582. <?php echo get_theme_mod( 'dh_mh_current_page_styles'); ?>
  2583. }
  2584. /** Top Header Current Item Styles **/
  2585. #et-secondary-nav li.current_page_item > a {
  2586. <?php echo get_theme_mod( 'dh_th_current_page_styles'); ?>
  2587. }
  2588.  
  2589. /** Primary Dropdown Width **/
  2590. .is-desktop #top-menu li:not(.module-in-menu):not(.nav-columns):not(.mega-menu) ul.sub-menu {
  2591. width: <?php echo $dh_primary_dropdown_width; ?>;
  2592. }
  2593. .is-desktop #top-menu li:not(.module-in-menu):not(.nav-columns):not(.mega-menu) ul.sub-menu a {
  2594. width: calc(<?php echo $dh_primary_dropdown_width; ?> - 40px);
  2595. }
  2596. /** Primary Dropdown Link Color **/
  2597. .is-desktop #top-menu li:not(.module-in-menu):not(.nav-columns) ul.sub-menu a {
  2598. color: <?php echo $dh_primary_dropdown_link_color; ?> !important;
  2599. }
  2600. /** Primary Dropdown Line Height **/
  2601. .is-desktop #top-menu li:not(.module-in-menu):not(.nav-columns) ul.sub-menu a {
  2602. line-height: <?php echo $dh_primary_dropdown_line_height; ?> !important;
  2603. }
  2604. /** Secondary Dropdown Width **/
  2605. .is-desktop #et-secondary-nav li:not(.module-in-menu):not(.nav-columns):not(.mega-menu) ul.sub-menu {
  2606. width: <?php echo $dh_secondary_dropdown_width; ?>;
  2607. }
  2608. .is-desktop #et-secondary-nav li:not(.module-in-menu):not(.nav-columns):not(.mega-menu) ul.sub-menu a {
  2609. width: calc(<?php echo $dh_secondary_dropdown_width; ?> - 2em);
  2610. margin-left: -1em;
  2611. }
  2612. /** Secondary Dropdown Link Color **/
  2613. .is-desktop #et-secondary-nav li:not(.module-in-menu):not(.nav-columns) ul.sub-menu a {
  2614. color: <?php echo $dh_secondary_dropdown_link_color; ?> !important;
  2615. }
  2616. /** Secondary Dropdown Line Height **/
  2617. .is-desktop #et-secondary-nav li:not(.module-in-menu):not(.nav-columns) ul.sub-menu a {
  2618. line-height: <?php echo $dh_secondary_dropdown_line_height; ?> !important;
  2619. }
  2620.  
  2621. /** Primary Nav Columns Width **/
  2622. .divi-hacks-nav-columns.is-desktop #main-header li.nav-columns:not(.module-in-menu) ul li a {
  2623. width: <?php echo $dh_nav_columns_width; ?> !important;
  2624. }
  2625. /** Secondary Nav Columns Width **/
  2626. .divi-hacks-nav-columns.is-desktop #et-secondary-nav li.nav-columns:not(.module-in-menu) ul li a {
  2627. width: <?php echo $dh_secondary_nav_columns_width; ?> !important;
  2628. }
  2629. /** MOBILE MENU **/
  2630. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et-cart-info span:before,
  2631. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et-cart-info span:before {
  2632. color: <?php echo $dh_mobile_cart_icon; ?>;
  2633. }
  2634.  
  2635. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et_mobile_menu li a,
  2636. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu li a {
  2637. color: <?php echo $dh_mobile_menu_text; ?>;
  2638. }
  2639.  
  2640. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .mobile_nav.opened .mobile_menu_bar_toggle::before,
  2641. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .mobile_nav.opened .mobile_menu_bar_toggle::before {
  2642. color: <?php echo $dh_mobile_open_toggle_icon; ?>;
  2643. }
  2644.  
  2645. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .mobile_nav.closed .mobile_menu_bar_toggle::before,
  2646. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .mobile_nav.closed .mobile_menu_bar_toggle::before {
  2647. color: <?php echo $dh_mobile_closed_toggle_icon; ?>;
  2648. }
  2649.  
  2650. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header #mobile_menu .current_page_item > a,
  2651. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header #mobile_menu .current_page_item > a {
  2652. color: <?php echo $dh_mobile_menu_current; ?>;
  2653. }
  2654.  
  2655. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu > li > ul.sub-menu,
  2656. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et_mobile_menu > li > ul.sub-menu li.menu-item a {
  2657. background-color: <?php echo $dh_mobile_submenu_bg_color; ?>;
  2658. }
  2659.  
  2660. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu li a,
  2661. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et_mobile_menu li a {
  2662. letter-spacing: <?php echo $dh_mobile_menu_letter_spacing; ?>;
  2663. }
  2664.  
  2665. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu .et_mobile_menu > li > a,
  2666. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et_mobile_menu .et_mobile_menu > li > a {
  2667. line-height: <?php echo $dh_mobile_menu_line_height; ?>;
  2668. }
  2669. .divi-hacks-mobile-menu-fullscreen.is-mobile #main-header .et_mobile_menu .sub-menu > li > a,
  2670. .divi-hacks-mobile-menu-slide-in.is-mobile #main-header .et_mobile_menu .sub-menu > li > a {
  2671. line-height: <?php echo $dh_mobile_menu_submenu_line_height; ?>;
  2672. }
  2673.  
  2674. /* HEADER */
  2675. #top-header {
  2676. background-image: url('<?php echo $dh_secondary_header_bg; ?>') ;
  2677. background-size: <?php echo $dh_secondary_header_bg_size; ?>;
  2678. background-repeat: <?php echo $dh_secondary_header_bg_repeat; ?>;
  2679. background-position: <?php echo $dh_secondary_header_bg_position; ?>;
  2680. }
  2681. #main-header {
  2682. background-image: url('<?php echo $dh_header_bg; ?>') ;
  2683. background-size: <?php echo $dh_main_header_bg_size; ?>;
  2684. background-repeat: <?php echo $dh_main_header_bg_repeat; ?>;
  2685. background-position: <?php echo $dh_main_header_bg_position; ?>;
  2686. }
  2687.  
  2688. /* FOOTER */
  2689. div#footer-bottom {
  2690. position: relative;
  2691. z-index:1;
  2692. align-items: center;
  2693. display: flex;
  2694. }
  2695. /** Secondary Nav Current Page Item Text Color **/
  2696. #main-footer li.current_page_item > a,
  2697. #main-footer li.current-menu-item > a:before {
  2698. color: <?php echo $dh_footer_menu_bar_current_item_color; ?> !important;
  2699. }
  2700. /** Secondary Nav Font Awesome Icon Size **/
  2701. .divi-hacks-font-awesome-icons #main-footer .fab > a:before,
  2702. .divi-hacks-font-awesome-icons #main-footer .far > a:before,
  2703. .divi-hacks-font-awesome-icons #main-footer .fas > a:before,
  2704. .divi-hacks-font-awesome-icons #main-footer .fal > a:before,
  2705. .divi-hacks-font-awesome-icons #main-footer .fa > a:before {
  2706. font-size: <?php echo $dh_footer_menu_bar_nav_icon_size; ?>
  2707. }
  2708. /** Secondary Nav Font Awesome Icon Color **/
  2709. .divi-hacks-font-awesome-icons #main-footer .fa > a:before,
  2710. .divi-hacks-font-awesome-icons #main-footer .fas > a:before,
  2711. .divi-hacks-font-awesome-icons #main-footer .far > a:before,
  2712. .divi-hacks-font-awesome-icons #main-footer .fab > a:before,
  2713. .divi-hacks-font-awesome-icons #main-footer .fal > a:before {
  2714. color: <?php echo $dh_footer_menu_bar_icon_color; ?>;
  2715. }
  2716. /** Main Footer Background **/
  2717. #main-footer {
  2718. background-image: url('<?php echo $dh_footer_bg; ?>') ;
  2719. background-size: <?php echo $dh_footer_menu_bar_bg_size; ?>;
  2720. background-repeat: <?php echo $dh_footer_menu_bar_bg_repeat; ?>;
  2721. background-position: <?php echo $dh_footer_menu_bar_bg_position; ?>;
  2722. }
  2723. /** DH Footer Copyright **/
  2724. .dh-footer-copyright { display: <?php echo get_theme_mod("dh_footer_links_copyright"); ?>; }
  2725.  
  2726. /* CUSTOM CSS */
  2727.  
  2728. @media only screen and (max-width:767px) {
  2729. <?php echo get_theme_mod( 'dh_phone_styles'); ?>
  2730. }
  2731. @media only screen and (max-width:980px) {
  2732. <?php echo get_theme_mod( 'dh_mobile_styles'); ?>
  2733. }
  2734. @media only screen and (min-width:480px) and (max-width:981px) {
  2735. <?php echo get_theme_mod( 'dh_tablet_styles'); ?>
  2736. }
  2737. @media only screen and (min-width:981px) {
  2738. <?php echo get_theme_mod( 'dh_desktop_styles'); ?>
  2739. }
  2740. /** Login Form Error Messages **/
  2741. <?php
  2742. /*function blank_username_password( $user, $username, $password ) {
  2743. if(isset($username) && isset($password)) {
  2744. global $page_id;
  2745. $id2 = get_option('dh-login-page');
  2746. $login_page = home_url( '/?page_id='. $id2. '/' );
  2747. if( $username == "" || $password == "" ) {
  2748. wp_redirect( $login_page . "&blank=1" ); exit;
  2749. }
  2750. }
  2751. }
  2752. add_filter( 'authenticate', 'blank_username_password', 1, 3);*/
  2753. //$page_showing = basename($_SERVER['REQUEST_URI']);
  2754. if(isset($_GET['login'])) {
  2755. $page_showing = $_GET['login'];
  2756.  
  2757. if($page_showing == 'failed') {
  2758. //if (strpos($page_showing, 'failed') !== false) {
  2759. ?>
  2760. .et_pb_login .et_pb_newsletter_form:before {
  2761. content: "Error: Invalid username and/or password." !important;
  2762. background: #ff6565;
  2763. color: #fff;
  2764. padding: 5px 20px;
  2765. border-radius: 5px;
  2766. font-weight: bold;
  2767. bottom: 10px !important;
  2768. position: relative;
  2769. font-family:inherit;
  2770. display: block;
  2771. box-sizing: border-box;
  2772. }
  2773. .et_pb_login .et_pb_newsletter_form {
  2774. padding-top: 10px;
  2775. }
  2776. <?php } }
  2777. //else if(strpos($page_showing, 'blank') !== false ) {
  2778. else if(isset($_GET['blank'])) {
  2779. if($_GET['blank'] == 1) {
  2780. ?>
  2781. .et_pb_login .et_pb_newsletter_form:before {
  2782. content: 'Error: Username and/or Password is empty.';
  2783. background: #ff6565;
  2784. color: #fff;
  2785. padding: 5px 20px;
  2786. border-radius: 5px;
  2787. font-weight: bold;
  2788. bottom: 10px !important;
  2789. position: relative;
  2790. font-family:inherit;
  2791. display: block;
  2792. box-sizing: border-box;
  2793. }
  2794. .et_pb_login .et_pb_newsletter_form {
  2795. padding-top: 10px;
  2796. }
  2797. <?php
  2798. }
  2799.  
  2800. }
  2801. ?>
  2802. </style>
  2803. <?php
  2804. }
  2805. add_action( 'wp_head', 'dh_switch_customizer_css' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement