Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.41 KB | None | 0 0
  1. <?php
  2.  
  3. /***************************************************
  4. * :: Header section render
  5. ***************************************************/
  6.  
  7. function svq_show_header() {
  8. svq_get_template_part( 'page-parts/header' );
  9. }
  10.  
  11. add_action( 'svq_header', 'svq_show_header' );
  12.  
  13.  
  14. /***************************************************
  15. * :: Footer section render
  16. ***************************************************/
  17.  
  18. function svq_show_footer() {
  19. get_sidebar( 'footer' );
  20. get_template_part( 'page-parts/footer-socket' );
  21. }
  22.  
  23. add_action( 'svq_footer', 'svq_show_footer' );
  24.  
  25.  
  26. /***************************************************
  27. * :: Single section render
  28. ***************************************************/
  29.  
  30. function svq_show_single() {
  31. get_template_part( 'page-parts/post/single' );
  32. }
  33.  
  34. add_action( 'svq_single', 'svq_show_single' );
  35.  
  36. /***************************************************
  37. * :: Archive section render
  38. ***************************************************/
  39.  
  40. function svq_show_archive() {
  41. get_template_part( 'page-parts/archive' );
  42. }
  43.  
  44. add_action( 'svq_archive', 'svq_show_archive' );
  45.  
  46.  
  47. /***************************************************
  48. * :: Add body classes
  49. ***************************************************/
  50.  
  51. add_filter( 'body_class', 'svq_body_classes' );
  52.  
  53. /*
  54. * Adds specific classes to body element
  55. *
  56. * @param array $classes
  57. * @return array
  58. * @since 1.0
  59. */
  60. function svq_body_classes( $classes = array() ) {
  61.  
  62. if ( is_admin_bar_showing() && svq_option( 'admin_bar', 1 ) == 1 ) {
  63. $classes[] = 'adminbar-enable';
  64. }
  65.  
  66. //is customizer
  67. if ( is_customize_preview() ) {
  68. $classes[] = 'customize-preview';
  69. }
  70.  
  71. if ( svq_option( 'enable_shadow', 1, true ) ) {
  72. $classes[] = 'enable-shadow';
  73. }
  74.  
  75. //footer is inactive
  76. if ( ! is_active_sidebar( 'footer-1' ) && ! is_active_sidebar( 'footer-2' ) && ! is_active_sidebar( 'footer-3' )
  77. && ! is_active_sidebar( 'footer-4' ) ) {
  78. SVQ_FW::set_config( 'footer_inactive', true );
  79. }
  80.  
  81. return $classes;
  82. }
  83.  
  84.  
  85. /***************************************************
  86. * :: Dynamic variables
  87. ***************************************************/
  88.  
  89. SVQ_FW::set_config( 'colors',
  90. array(
  91. 'primary' => [ 'title' => esc_html__( 'Primary color', 'seeko' ), 'type' => 'color', 'default' => '#F21483' ],
  92. 'secondary' => [
  93. 'title' => esc_html__( 'Secondary color', 'seeko' ),
  94. 'type' => 'color',
  95. 'default' => '#7c7c7c'
  96. ],
  97. 'tertiary' => [
  98. 'title' => esc_html__( 'Tertiary color', 'seeko' ),
  99. 'type' => 'color',
  100. 'default' => '#555EFF'
  101. ],
  102. 'success' => [ 'title' => esc_html__( 'Success color', 'seeko' ), 'type' => 'color', 'default' => '#1FCB41' ],
  103. 'info' => [ 'title' => esc_html__( 'Info color', 'seeko' ), 'type' => 'color', 'default' => '#10B8C1' ],
  104. 'warning' => [ 'title' => esc_html__( 'Warning color', 'seeko' ), 'type' => 'color', 'default' => '#FFB91A' ],
  105. 'danger' => [ 'title' => esc_html__( 'Danger color', 'seeko' ), 'type' => 'color', 'default' => '#FF0000' ],
  106. 'light' => [ 'title' => esc_html__( 'Light color', 'seeko' ), 'type' => 'color', 'default' => '#F8F8F8' ],
  107. 'dark' => [ 'title' => esc_html__( 'Dark color', 'seeko' ), 'type' => 'color', 'default' => '#000000' ],
  108. )
  109. );
  110.  
  111. SVQ_FW::set_config( 'styling_variables',
  112. array(
  113. 'body-color' => [
  114. 'title' => esc_html__( 'Text color', 'seeko' ),
  115. 'type' => 'color',
  116. 'default' => '#333333',
  117. ],
  118. 'headings-color' => [
  119. 'title' => esc_html__( 'Headings color', 'seeko' ),
  120. 'type' => 'color',
  121. 'default' => '#000000',
  122. ],
  123. 'body_bg_enable' => [
  124. 'title' => esc_html__( 'Custom Body Background', 'seeko' ),
  125. 'type' => 'switch',
  126. 'default' => '0',
  127. 'transport' => 'auto'
  128. ],
  129. 'body_bg' => [
  130. 'title' => esc_html__( 'BG image', 'seeko' ),
  131. 'type' => 'background',
  132. 'default' => array(
  133. 'background-color' => '#ffffff',
  134. 'background-image' => '',
  135. 'background-repeat' => 'no-repeat',
  136. 'background-position' => 'center center',
  137. 'background-size' => 'auto',
  138. 'background-attachment' => 'scroll',
  139. ),
  140. 'output' => array(
  141. array(
  142. 'element' => 'body',
  143. 'property' => 'background',
  144. ),
  145. ),
  146. 'required' => array(
  147. array(
  148. 'setting' => 'body_bg_enable',
  149. 'operator' => '!=',
  150. 'value' => '0',
  151. ),
  152. ),
  153. ],
  154. 'border-color' => [
  155. 'title' => esc_html__( 'Border color', 'seeko' ),
  156. 'type' => 'color',
  157. 'default' => '#eeeeee'
  158. ],
  159. 'border-radius' => [
  160. 'title' => esc_html__( 'Border radius', 'seeko' ),
  161. 'type' => 'seeko-input',
  162. 'default' => [ 'size' => 8, 'unit' => 'px' ],
  163. 'units' => [ 'px' ],
  164. 'defaultUnit' => 'px',
  165. 'column' => '6',
  166. 'transport' => 'postMessage',
  167. ],
  168. )
  169. );
  170.  
  171. SVQ_FW::set_config( 'typography',
  172. [
  173. 'typography_base',
  174. 'typography_heading',
  175. 'font_family_distinct',
  176. 'typography_h1',
  177. 'typography_h2',
  178. 'typography_h3',
  179. 'typography_h4',
  180. 'typography_h5',
  181. 'typography_h6',
  182. ]
  183. );
  184.  
  185. SVQ_FW::set_config( 'blog_intro', esc_html__( 'Easily connect with our stories, events and news.', 'seeko' ) );
  186.  
  187.  
  188. add_filter( 'svq_get_dynamic_variables', 'svq_base_dynamic_variables' );
  189. function svq_base_dynamic_variables( $variables ) {
  190.  
  191.  
  192. //Site colors
  193. foreach ( SVQ_FW::get_config( 'colors' ) as $slug => $s ) {
  194. if ( svq_option( $slug, $s['default'] ) ) {
  195. $variables[ $slug ] = svq_option( $slug, $s['default'] );
  196. }
  197.  
  198. }
  199.  
  200. //Styling colors
  201. foreach ( SVQ_FW::get_config( 'styling_variables' ) as $slug => $s ) {
  202.  
  203. if ( $slug == 'body_bg_enable' ) {
  204. continue;
  205. }
  206. $val = svq_option( $slug, $s['default'] );
  207.  
  208. if ( $slug == 'body_bg' ) {
  209. if ( is_array( $val ) && isset( $val['background-color'] ) ) {
  210. $variables['body-bg'] = $val['background-color'];
  211. continue;
  212. }
  213. }
  214.  
  215. if ( $val !== '' ) {
  216. if ( $slug == 'border-radius' && is_array( $val ) ) {
  217. $val = ( (int) $val['size'] ) / 16 . 'rem';
  218. }
  219. $variables[ $slug ] = $val;
  220. }
  221. }
  222.  
  223. //Base Typography
  224. $typography_val = svq_option( 'typography_base' );
  225. if ( $typography_val ) {
  226. if (strpos( $typography_val['font-family'], ' ' ) !== false) {
  227. $typography_val['font-family'] = '"' . $typography_val['font-family'] . '"';
  228. }
  229.  
  230. $variables['font-family-primary'] = $typography_val['font-family'];
  231. if ( strpos( $typography_val['variant'], 'italic' ) !== false ) {
  232. $typography_val['variant'] = str_replace( 'italic', '', $typography_val['variant'] );
  233. $variables['font-style-base'] = 'italic';
  234. }
  235. if ( $typography_val['variant'] == 'regular' ) {
  236. $typography_val['variant'] = 'normal';
  237. }
  238. $variables['font-weight-base'] = $typography_val['variant'];
  239. }
  240.  
  241. if ( $font_size_base = svq_option( 'font_size_base' ) ) {
  242. if (isset( $font_size_base['desktop'] ) ) {
  243. $variables['font-size-base-lg'] = $font_size_base['desktop']['size'] . $font_size_base['desktop']['unit'];
  244. }
  245. if (isset( $font_size_base['tablet'] ) ) {
  246. $variables['font-size-base-md'] = $font_size_base['tablet']['size'] . $font_size_base['tablet']['unit'];
  247. }
  248. if (isset( $font_size_base['mobile'] ) ) {
  249. $variables['font-size-base-sm'] = $font_size_base['mobile']['size'] . $font_size_base['mobile']['unit'];
  250. }
  251. }
  252.  
  253. if ( $line_height_base = svq_option( 'line_height_base' ) ) {
  254. $variables['line-height-base'] = $line_height_base['size'] . str_replace( '-', '', $line_height_base['unit'] );
  255. }
  256.  
  257. //Headings base
  258. $typography_val = svq_option( 'typography_heading' );
  259. if ( $typography_val ) {
  260. if (strpos( $typography_val['font-family'], ' ' ) !== false) {
  261. $typography_val['font-family'] = '"' . $typography_val['font-family'] . '"';
  262. }
  263. $variables['headings-font-family'] = $typography_val['font-family'] . ', Arial, sans-serif';
  264. $variables['headings-line-height'] = $typography_val['line-height'];
  265. if ( strpos( $typography_val['variant'], 'italic' ) !== false ) {
  266. $typography_val['variant'] = str_replace( 'italic', '', $typography_val['variant'] );
  267. $variables['headings-font-style'] = 'italic';
  268. }
  269. if ( $typography_val['variant'] == 'regular' ) {
  270. $typography_val['variant'] = 'normal';
  271. }
  272. $variables['headings-font-weight'] = $typography_val['variant'];
  273.  
  274. }
  275.  
  276. $typography_val = svq_option( 'font_family_distinct' );
  277. if ( $typography_val && isset( $typography_val['font-family'] ) && $typography_val['font-family'] != '' ) {
  278. if (strpos( $typography_val['font-family'], ' ' ) !== false) {
  279. $typography_val['font-family'] = '"' . $typography_val['font-family'] . '"';
  280. }
  281. $variables['font-family-distinct'] = $typography_val['font-family'];
  282. }
  283.  
  284. //H1-H6
  285. for ( $i = 1; $i <= 6; $i ++ ) {
  286. $typography_val = svq_option( 'typography_h' . $i );
  287. if ( $typography_val ) {
  288. if ( strpos( $typography_val['variant'], 'italic' ) !== false ) {
  289. $typography_val['variant'] = str_replace( 'italic', '', $typography_val['variant'] );
  290. $variables[ 'h' . $i . '-font-style' ] = 'italic';
  291. }
  292. if ( $typography_val['variant'] == 'regular' ) {
  293. $typography_val['variant'] = 'normal';
  294. }
  295. if ( isset( $typography_val['variant'] ) && $typography_val['variant'] ) {
  296. $variables[ 'h' . $i . '-font-weight' ] = $typography_val['variant'];
  297. }
  298. }
  299.  
  300. if ( $h_font_size = svq_option('font_size_h'. $i ) ) {
  301.  
  302. if (isset( $h_font_size['desktop'] ) ) {
  303. $variables['h' . $i . '-font-size-lg'] = $h_font_size['desktop']['size'] . $h_font_size['desktop']['unit'];
  304. }
  305. if (isset( $h_font_size['tablet'] ) ) {
  306. $variables['h' . $i . '-font-size-md'] = $h_font_size['tablet']['size'] . $h_font_size['tablet']['unit'];
  307. }
  308. if (isset( $h_font_size['mobile'] ) ) {
  309. $variables['h' . $i . '-font-size'] = $h_font_size['mobile']['size'] . $h_font_size['mobile']['unit'];
  310. }
  311. }
  312. }
  313.  
  314. return $variables;
  315. }
  316.  
  317.  
  318. /***************************************************
  319. * :: Theme options
  320. ***************************************************/
  321.  
  322. add_filter( 'svq_theme_settings', 'svq_base_settings' );
  323.  
  324. function svq_base_settings( $sq ) {
  325. //
  326. // Settings Sections
  327. //
  328.  
  329. $sq['panels']['seeko'] = array(
  330. 'title' => esc_html__( 'Seeko Options', 'seeko' ),
  331. 'description' => __( 'Seeko Theme specific settings', 'seeko' ),
  332. 'priority' => 10
  333. );
  334.  
  335. $sq['sec']['svq_section_layout'] = array(
  336. 'title' => esc_html__( 'Layout', 'seeko' ),
  337. 'panel' => 'seeko',
  338. 'priority' => 8
  339. );
  340. $sq['sec']['svq_section_styling'] = array(
  341. 'title' => esc_html__( 'Site Colors', 'seeko' ),
  342. 'panel' => 'seeko',
  343. 'priority' => 10
  344. );
  345. $sq['sec']['svq_section_typography'] = array(
  346. 'title' => esc_html__( 'Typography', 'seeko' ),
  347. 'panel' => 'seeko',
  348. 'priority' => 12
  349. );
  350.  
  351. $sq['sec']['svq_section_header'] = array(
  352. 'title' => esc_html__( 'Header', 'seeko' ),
  353. 'panel' => 'seeko',
  354. 'priority' => 13
  355. );
  356.  
  357. $sq['sec']['svq_section_blog'] = array(
  358. 'title' => esc_html__( 'Blog', 'seeko' ),
  359. 'panel' => 'seeko',
  360. 'priority' => 14
  361. );
  362.  
  363. $sq['sec']['svq_section_footer'] = array(
  364. 'title' => esc_html__( 'Footer', 'seeko' ),
  365. 'panel' => 'seeko',
  366. 'priority' => 15
  367. );
  368.  
  369.  
  370. //
  371. // Layout
  372. //
  373.  
  374. $sq['set']['svq_section_layout'][] = array(
  375. 'section' => 'svq_section_layout',
  376. 'id' => 'site_layout',
  377. 'type' => 'seeko-radio-image',
  378. 'title' => esc_html__( 'Site Layout', 'seeko' ),
  379. 'choices' => SVQ_FW::get_config( 'layouts' ),
  380. 'default' => 'full',
  381. 'transport' => 'refresh'
  382. );
  383.  
  384. $sq['set']['svq_section_layout'][] = array(
  385. 'id' => 'enable_shadow',
  386. 'type' => 'switch',
  387. 'title' => esc_html__( 'Depth effect shadow', 'seeko' ),
  388. 'default' => '1',
  389. 'section' => 'svq_section_layout',
  390. 'description' => esc_html__( 'Site elements like images and inputs will have nice shadows.', 'seeko' ),
  391. 'customizer' => true,
  392. 'transport' => 'refresh'
  393. );
  394.  
  395.  
  396. //
  397. // Styling.
  398. //
  399.  
  400. $sq['set']['svq_section_styling'][] = array(
  401. 'type' => 'custom',
  402. 'id' => 'separator_styling_colors',
  403. 'default' => '<h4 class="customizer-separator">General site styling</h4>',
  404. 'section' => 'svq_section_styling',
  405. 'customizer' => true,
  406. 'transport' => 'refresh'
  407. );
  408.  
  409. foreach ( SVQ_FW::get_config( 'styling_variables' ) as $slug => $s ) {
  410.  
  411. $s['id'] = $slug;
  412. $s['section'] = 'svq_section_styling';
  413. $s['transport'] = isset( $s['transport'] ) ? $s['transport'] : 'refresh';
  414. $s['output'] = isset( $s['output'] ) ? $s['output'] : false;
  415. $s['active_callback'] = isset( $s['required'] ) ? $s['required'] : false;
  416.  
  417. $sq['set']['svq_section_styling'][] = $s;
  418. }
  419.  
  420. $sq['set']['svq_section_styling'][] = array(
  421. 'type' => 'custom',
  422. 'id' => 'separator1',
  423. 'default' => '<h4 class="customizer-separator">Site Colors</h4>',
  424. 'section' => 'svq_section_styling',
  425. 'customizer' => true,
  426. 'transport' => 'refresh'
  427. );
  428.  
  429. foreach ( SVQ_FW::get_config( 'colors' ) as $slug => $s ) {
  430. $sq['set']['svq_section_styling'][] = array(
  431. 'id' => str_replace( '-', '_', $slug ),
  432. 'type' => $s['type'],
  433. 'title' => $s['title'],
  434. 'default' => $s['default'],
  435. 'section' => 'svq_section_styling',
  436. 'customizer' => true,
  437. 'transport' => 'auto',
  438. 'active_callback' => isset( $s['required'] ) ? $s['required'] : false,
  439. );
  440. }
  441.  
  442. $sq['set']['svq_section_typography'][] = array(
  443. 'id' => 'webfonts_method',
  444. 'type' => 'select',
  445. 'title' => esc_html__( 'Google font load method', 'seeko' ),
  446. 'default' => 'embed',
  447. 'choices' => [
  448. 'link' => 'Google Link',
  449. 'embed' => 'Embedded in page',
  450. ],
  451. 'section' => 'svq_section_typography',
  452. 'description' => esc_html__( 'How to load Google fonts: Embedded method will add inline style using font-face. Google Link will add a link tag from Google API.', 'seeko' ),
  453. 'customizer' => true,
  454. 'transport' => 'postMessage'
  455. );
  456.  
  457. $sq['set']['svq_section_typography'][] = array(
  458. 'type' => 'seeko-divider',
  459. 'id' => 'separator_typography_webfont',
  460. 'section' => 'svq_section_typography',
  461. );
  462.  
  463. //svq_section_typography
  464. $sq['set']['svq_section_typography'][] = array(
  465. 'type' => 'typography',
  466. 'settings' => 'typography_base',
  467. 'label' => esc_attr__( 'Body Typography', 'seeko' ),
  468. 'section' => 'svq_section_typography',
  469. 'priority' => 10,
  470. 'transport' => 'auto',
  471. 'default' => array(
  472. 'font-family' => 'Muli',
  473. 'variant' => 'regular',
  474. ),
  475. 'choices' => array(
  476. 'fonts' => array(
  477. 'google' => array( 'popularity', 300 ),
  478. ),
  479. 'variant' => [ 'regular', 'italic', '700' ],
  480. ),
  481. 'output' => is_customize_preview() || is_admin() ? array(
  482. array(
  483. 'element' => 'body',
  484. 'property' => 'font',
  485. ),
  486. ) : false,
  487. );
  488.  
  489. $sq['set']['svq_section_typography'][] = array(
  490. 'id' => 'font_size_base',
  491. 'type' => 'seeko-input',
  492. 'title' => esc_html__( 'Font size', 'seeko' ),
  493.  
  494. 'default' => [
  495. 'desktop' => [
  496. 'size' => '18',
  497. 'unit' => 'px'
  498. ],
  499. 'tablet' => [
  500. 'size' => '17',
  501. 'unit' => 'px'
  502. ],
  503. 'mobile' => [
  504. 'size' => '16',
  505. 'unit' => 'px'
  506. ],
  507. ],
  508. 'column' => '6',
  509. 'units' => [ 'px', 'em', 'rem' ],
  510. 'defaultUnit' => 'px',
  511. 'responsive' => true,
  512.  
  513. 'section' => 'svq_section_typography',
  514. 'transport' => 'postMessage',
  515. 'output' => array(
  516. array(
  517. 'element' => 'body',
  518. 'property' => 'font-size',
  519. ),
  520. ),
  521. );
  522.  
  523. $sq['set']['svq_section_typography'][] = array(
  524. 'id' => 'line_height_base',
  525. 'type' => 'seeko-input',
  526. 'title' => esc_html__( 'Line height', 'seeko' ),
  527.  
  528. 'default' => [
  529. 'size' => '1.75',
  530. 'unit' => '-'
  531. ],
  532. 'column' => '6',
  533. 'units' => [ '-', 'px', 'em', 'rem' ],
  534. 'defaultUnit' => '-',
  535.  
  536. 'section' => 'svq_section_typography',
  537. 'transport' => 'postMessage',
  538. 'output' => is_customize_preview() || is_admin() ? array(
  539. array(
  540. 'element' => 'body',
  541. 'property' => 'line-height',
  542. ),
  543. ) : false,
  544. );
  545.  
  546. $sq['set']['svq_section_typography'][] = array(
  547. 'type' => 'seeko-divider',
  548. 'id' => 'separator_typography_base',
  549. 'section' => 'svq_section_typography',
  550. );
  551.  
  552. //svq_section_typography
  553. $sq['set']['svq_section_typography'][] =
  554. array(
  555. 'type' => 'typography',
  556. 'settings' => 'typography_heading',
  557. 'label' => esc_attr__( 'Headings Default Typography', 'seeko' ),
  558. 'section' => 'svq_section_typography',
  559. //'priority' => 11,
  560. 'transport' => 'auto',
  561. 'default' => array(
  562. 'font-family' => 'Fira Sans',
  563. 'variant' => '500',
  564. 'line-height' => '1.4',
  565. ),
  566.  
  567. 'choices' => array(
  568. 'fonts' => array(
  569. 'google' => array( 'popularity', 300 ),
  570. ),
  571. 'variant' => [ 'regular', 'italic' ],
  572. ),
  573. 'output' => is_customize_preview() || is_admin() ? array(
  574. array(
  575. 'element' => 'h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6',
  576. //'property' => 'font',
  577. ),
  578. ) : false,
  579. 'description' => esc_html__( 'It will be used for all H1-H6 tags. You can override a specific heading below this section', 'seeko' ),
  580. );
  581.  
  582. $sq['set']['svq_section_typography'][] = array(
  583. 'type' => 'seeko-divider',
  584. 'id' => 'separator_typography_heading',
  585. 'section' => 'svq_section_typography',
  586. );
  587.  
  588. $heading_defaults = [
  589. [ '57', '41.5', '39' ],
  590. [ '43', '33', '31' ],
  591. [ '32', '26.5', '25' ],
  592. [ '24', '21', '20' ],
  593. [ '18', '17', '16' ],
  594. [ '13.5', '13.5', '13' ],
  595.  
  596. ];
  597.  
  598. for ( $i = 1; $i <= 6; $i ++ ) {
  599. //svq_section_typography
  600. $sq['set']['svq_section_typography'][] =
  601. array(
  602. 'type' => 'typography',
  603. 'settings' => 'typography_h' . $i,
  604. 'label' => 'H' . $i . ' ' . esc_attr__( 'Typography', 'seeko' ),
  605. 'section' => 'svq_section_typography',
  606. //'priority' => 11,
  607. 'transport' => 'auto',
  608. 'default' => array(
  609. 'font-family' => '',
  610. 'variant' => 'regular',
  611. ),
  612. 'choices' => array(
  613. 'fonts' => array(
  614. 'google' => array( 'popularity', 300 ),
  615. ),
  616. 'variant' => [ 'regular', 'italic', '700' ],
  617. ),
  618. 'output' => is_customize_preview() || is_admin() ? array(
  619. array(
  620. 'element' => 'h' . $i . ', .h' . $i,
  621. 'property' => 'font',
  622. ),
  623. ) : false,
  624. );
  625.  
  626. $sq['set']['svq_section_typography'][] = array(
  627. 'id' => 'font_size_h' . $i,
  628. 'type' => 'seeko-input',
  629. 'title' => esc_html__( 'Font size', 'seeko' ),
  630.  
  631. 'default' => [
  632. 'desktop' => [
  633. 'size' => $heading_defaults[ $i - 1 ][0],
  634. 'unit' => 'px'
  635. ],
  636. 'tablet' => [
  637. 'size' => $heading_defaults[ $i - 1 ][1],
  638. 'unit' => 'px'
  639. ],
  640. 'mobile' => [
  641. 'size' => $heading_defaults[ $i - 1 ][2],
  642. 'unit' => 'px'
  643. ],
  644. ],
  645. 'column' => '6',
  646. 'units' => [ 'px', 'em', 'rem' ],
  647. 'defaultUnit' => 'px',
  648. 'responsive' => true,
  649.  
  650. 'section' => 'svq_section_typography',
  651. 'transport' => 'postMessage',
  652. 'output' => is_customize_preview() || is_admin() ? array(
  653. array(
  654. 'element' => 'h' . $i . ', .h' . $i,
  655. 'property' => 'font-size',
  656. ),
  657. ) : false,
  658. );
  659.  
  660. $sq['set']['svq_section_typography'][] = array(
  661. 'id' => 'line_height_h' . $i,
  662. 'type' => 'seeko-input',
  663. 'title' => esc_html__( 'Line height', 'seeko' ),
  664. 'column' => '6',
  665. 'units' => [ '-', 'px', 'em', 'rem' ],
  666. 'defaultUnit' => '-',
  667. 'responsive' => true,
  668.  
  669. 'section' => 'svq_section_typography',
  670. 'transport' => 'postMessage',
  671. 'output' => array(
  672. array(
  673. 'element' => 'h' . $i . ', .h' . $i,
  674. 'property' => 'line-height',
  675. ),
  676. ),
  677. );
  678.  
  679. $sq['set']['svq_section_typography'][] = array(
  680. 'type' => 'seeko-divider',
  681. 'id' => 'separator_typography_h' . $i,
  682. 'section' => 'svq_section_typography',
  683. );
  684. }
  685.  
  686. //svq_section_typography
  687. $sq['set']['svq_section_typography']['font_family_distinct'] =
  688. array(
  689. 'type' => 'typography',
  690. 'settings' => 'font_family_distinct',
  691. 'label' => esc_attr__( 'BlockQuote Single Page', 'seeko' ),
  692. 'section' => 'svq_section_typography',
  693. //'priority' => 11,
  694. 'transport' => 'auto',
  695. 'default' => array(
  696. 'font-family' => 'Merriweather',
  697. 'variant' => '300italic',
  698. ),
  699.  
  700. 'choices' => array(
  701. 'fonts' => array(
  702. 'google' => array( 'popularity', 300 ),
  703. ),
  704. //'variant' => [ 'italic' ],
  705. ),
  706. 'output' => is_customize_preview() || is_admin() ? array(
  707. array(
  708. 'element' => '.quote-highlight blockquote, .wp-block-pullquote blockquote, .wp-block-quote.is-large',
  709. //'property' => 'font',
  710. ),
  711. ) : false,
  712. 'description' => esc_html__( 'It will be used for blockquote tags.', 'seeko' ),
  713. );
  714.  
  715. //Header
  716. if ( defined('STAX_VERSION') ) {
  717. $sq['set']['svq_section_header'][] = array(
  718. 'type' => 'custom',
  719. 'id' => 'separator_header_stax_on',
  720. 'default' => '<h4 class="customizer-separator">' .
  721. '<a target="_blank" href="' . esc_url( home_url( '/?stax-editor' ) ) . '">Go to Header Builder</a>' .
  722. '</h4>' .
  723. '<p>You are using our STAX Header builder to create an advanced header, awesome.</p>',
  724. 'section' => 'svq_section_header',
  725. 'transport' => 'refresh'
  726. );
  727. }
  728.  
  729. $current_url = admin_url( 'customize.php?autofocus[section]=svq_section_header' );
  730. $url = $current_url . '&svq_action=activate_plugin&plugin=stax';
  731.  
  732. function svq_is_normal_header() {
  733. if ( ! defined('STAX_VERSION') ) {
  734. return true;
  735. }
  736. return false;
  737. }
  738.  
  739. $sq['set']['svq_section_header'][] = array(
  740. 'type' => 'custom',
  741. 'id' => 'separator_header_stax',
  742. 'default' => '<h4 class="customizer-separator">' .
  743. 'Activate Header Builder' .
  744. '</h4>' .
  745. '<p>Take advantage of our advanced header features by activating <strong>STAX Header builder</strong>.</p>' .
  746. '<br><a class="button button-primary" target="_blank" href="' . esc_url( wp_nonce_url ( $url, 'activate_plugin', 'svq_nonce' ) ) . '">' .
  747. '<img src="'. esc_url( get_template_directory_uri() . '/assets/img/stax-16.png' ) .'"> ' .
  748. 'Activate Header Builder</a>' .
  749. '<br><br>Below is it just a limited set of settings.' .
  750. '<h4 class="customizer-separator">Default header settings</h4>',
  751. 'section' => 'svq_section_header',
  752. 'transport' => 'refresh',
  753. 'active_callback' => 'svq_is_normal_header',
  754. );
  755.  
  756. $sq['set']['svq_section_header'][] = array(
  757. 'type' => 'typography',
  758. 'settings' => 'header_typography',
  759. 'label' => esc_attr__( 'Header Typography', 'seeko' ),
  760. 'section' => 'svq_section_header',
  761. 'transport' => 'auto',
  762. 'default' => array(
  763. 'font-family' => 'inherit',
  764. 'variant' => 'regular',
  765. 'letter-spacing' => '',
  766. 'color' => '#1f1f1f',
  767. 'text-transform' => 'none',
  768. ),
  769.  
  770. 'choices' => array(
  771. 'fonts' => array(
  772. 'google' => array( 'popularity', 300 ),
  773. ),
  774. ),
  775. 'output' => svq_is_normal_header() ? array(
  776. array(
  777. 'element' => '#header, #header a'
  778. ),
  779. ) : false,
  780. 'active_callback' => 'svq_is_normal_header',
  781. );
  782.  
  783. $sq['set']['svq_section_header'][] = array(
  784. 'id' => 'header_font_size',
  785. 'type' => 'seeko-input',
  786. 'title' => esc_html__( 'Font size', 'seeko' ),
  787.  
  788. 'default' => [
  789. 'desktop' => [
  790. 'size' => '16',
  791. 'unit' => 'px'
  792. ],
  793. 'tablet' => [
  794. 'size' => '15',
  795. 'unit' => 'px'
  796. ],
  797. 'mobile' => [
  798. 'size' => '14',
  799. 'unit' => 'px'
  800. ],
  801. ],
  802. 'column' => '6',
  803. 'units' => [ 'px', 'em', 'rem' ],
  804. 'defaultUnit' => 'px',
  805. 'responsive' => true,
  806.  
  807. 'section' => 'svq_section_header',
  808. 'transport' => 'postMessage',
  809. 'output' => svq_is_normal_header() ? array(
  810. array(
  811. 'element' => '#header, #header a',
  812. 'property' => 'font-size',
  813. ),
  814. ) : false,
  815. 'active_callback' => 'svq_is_normal_header',
  816. );
  817.  
  818. $sq['set']['svq_section_header'][] = array(
  819. 'id' => 'header_line_height',
  820. 'type' => 'seeko-input',
  821. 'title' => esc_html__( 'Line height', 'seeko' ),
  822. 'default' => [
  823. 'desktop' => [
  824. 'size' => '',
  825. 'unit' => '-'
  826. ],
  827. 'tablet' => [
  828. 'size' => '',
  829. 'unit' => '-'
  830. ],
  831. 'mobile' => [
  832. 'size' => '',
  833. 'unit' => '-'
  834. ],
  835. ],
  836. 'column' => '6',
  837. 'units' => [ '-', 'px', 'em', 'rem' ],
  838. 'defaultUnit' => '-',
  839. 'section' => 'svq_section_header',
  840. 'transport' => 'postMessage',
  841. 'output' => svq_is_normal_header() ? array(
  842. array(
  843. 'element' => '#header, #header a',
  844. 'property' => 'line-height'
  845. ),
  846. ) : false,
  847. 'active_callback' => 'svq_is_normal_header',
  848. );
  849.  
  850.  
  851. $sq['set']['svq_section_header'][] = [
  852. 'id' => 'header_bg',
  853. 'title' => esc_html__( 'Background', 'seeko' ),
  854. 'type' => 'background',
  855. 'default' => array(
  856. 'background-color' => '#ffffff',
  857. ),
  858. 'output' => svq_is_normal_header() ? array(
  859. array(
  860. 'element' => '#header',
  861. 'property' => 'background',
  862. ),
  863. ) : false,
  864. 'section' => 'svq_section_header',
  865. 'transport' => 'auto',
  866. 'active_callback' => 'svq_is_normal_header',
  867. ];
  868.  
  869. $sq['set']['svq_section_header'][] = array(
  870. 'type' => 'custom',
  871. 'id' => 'separator_header_drop',
  872. 'default' => '<h4 class="customizer-separator">Dropdown</h4>',
  873. 'section' => 'svq_section_header',
  874. 'transport' => 'refresh',
  875. 'active_callback' => 'svq_is_normal_header',
  876. );
  877.  
  878. $sq['set']['svq_section_header'][] = [
  879. 'id' => 'header_submenu_color',
  880. 'title' => esc_html__( 'Link Color', 'seeko' ),
  881. 'type' => 'color',
  882. 'default' => '#333333',
  883. 'output' => svq_is_normal_header() ? array(
  884. array(
  885. 'element' => '#header ul.dropdown-menu li a',
  886. 'property' => 'color',
  887. ),
  888. ) : false,
  889. 'section' => 'svq_section_header',
  890. 'transport' => 'auto',
  891. 'active_callback' => 'svq_is_normal_header',
  892. ];
  893.  
  894. $sq['set']['svq_section_header'][] = [
  895. 'id' => 'header_submenu_bg',
  896. 'title' => esc_html__( 'Background color', 'seeko' ),
  897. 'type' => 'color',
  898. 'default' => '#ffffff',
  899. 'output' => svq_is_normal_header() ? array(
  900. array(
  901. 'element' => '#header ul.dropdown-menu',
  902. 'property' => 'background-color',
  903. ),
  904. ) : false,
  905. 'section' => 'svq_section_header',
  906. 'transport' => 'auto',
  907. 'active_callback' => 'svq_is_normal_header',
  908. ];
  909.  
  910.  
  911.  
  912. //Blog
  913.  
  914. $sq['set']['svq_section_blog'][] = array(
  915. 'id' => 'blog_layout',
  916. 'type' => 'seeko-radio-image',
  917. 'title' => esc_html__( 'Single Post Layout', 'seeko' ),
  918. 'default' => 'default',
  919. 'choices' => [
  920. 'default' =>
  921. [
  922. 'alt' => 'Default',
  923. 'img' => SVQ_LIB_URI . '/assets/images/default-layout.png',
  924. ]
  925. ] + SVQ_FW::get_config( 'layouts' ),
  926. 'section' => 'svq_section_blog',
  927. 'customizer' => true,
  928. 'transport' => 'refresh'
  929. );
  930.  
  931. $sq['set']['svq_section_blog'][] = array(
  932. 'id' => 'blog_archive_layout',
  933. 'type' => 'seeko-radio-image',
  934. 'title' => esc_html__( 'Archive Layout', 'seeko' ),
  935. 'default' => 'default',
  936. 'choices' => [
  937. 'default' =>
  938. [
  939. 'alt' => 'Default',
  940. 'img' => SVQ_LIB_URI . '/assets/images/default-layout.png',
  941. ]
  942. ] + SVQ_FW::get_config( 'layouts' ),
  943. 'section' => 'svq_section_blog',
  944. 'customizer' => true,
  945. 'transport' => 'refresh'
  946. );
  947.  
  948. $sq['set']['svq_section_blog'][] = array(
  949. 'type' => 'custom',
  950. 'id' => 'separator_blog_archive',
  951. 'default' => '<h4 class="customizer-separator">Archive page</h4>',
  952. 'section' => 'svq_section_blog',
  953. 'customizer' => true,
  954. 'transport' => 'refresh'
  955. );
  956.  
  957. $sq['set']['svq_section_blog'][] = array(
  958. 'id' => 'blog_title',
  959. 'type' => 'text',
  960. 'title' => esc_html__( 'Blog Page title', 'seeko' ),
  961. 'default' => 'Blog',
  962. 'section' => 'svq_section_blog',
  963. 'description' => esc_html__( 'Set the title of the Blog page when is set as homepage', 'seeko' ),
  964. 'customizer' => true,
  965. 'transport' => 'refresh'
  966. );
  967. $sq['set']['svq_section_blog'][] = array(
  968. 'id' => 'blog_intro',
  969. 'type' => 'text',
  970. 'title' => esc_html__( 'Blog Page Intro Text', 'seeko' ),
  971. 'default' => SVQ_FW::get_config( 'blog_intro' ),
  972. 'section' => 'svq_section_blog',
  973. 'description' => esc_html__( 'Set a small description text to show on the blog page', 'seeko' ),
  974. 'partial_refresh' => array(
  975. 'blog_intro' => array(
  976. 'selector' => '.svq-blog-intro',
  977. 'render_callback' => function() {
  978. echo esc_html( svq_option( 'blog_intro', '' ) );
  979. },
  980. ),
  981. ),
  982. );
  983. $sq['set']['svq_section_blog'][] = array(
  984. 'id' => 'blog_show_cats',
  985. 'type' => 'switch',
  986. 'title' => esc_html__( 'Show categories on blog page', 'seeko' ),
  987. 'default' => '0',
  988. 'section' => 'svq_section_blog',
  989. //'description' => '',
  990. 'partial_refresh' => array(
  991. 'blog_cats' => array(
  992. 'selector' => '.blog-filters',
  993. 'render_callback' => function() {
  994. if ( svq_option( 'blog_show_cats', 1 ) ) {
  995. svq_show_categories();
  996. }
  997. },
  998. ),
  999. ),
  1000. );
  1001.  
  1002. $sq['set']['svq_section_blog'][] = array(
  1003. 'id' => 'blog_author_meta_archive',
  1004. 'type' => 'switch',
  1005. 'title' => esc_html__( 'Show author meta on archive', 'seeko' ),
  1006. 'default' => '1',
  1007. 'section' => 'svq_section_blog',
  1008. 'description' => esc_html__( 'Show author meta under post title on archives', 'seeko' ),
  1009. );
  1010.  
  1011. $sq['set']['svq_section_blog'][] = array(
  1012. 'type' => 'custom',
  1013. 'id' => 'separator_blog_single',
  1014. 'default' => '<h4 class="customizer-separator">Single Post page</h4>',
  1015. 'section' => 'svq_section_blog',
  1016. 'customizer' => true,
  1017. 'transport' => 'refresh'
  1018. );
  1019.  
  1020. $sq['set']['svq_section_blog'][] = array(
  1021. 'id' => 'blog_author_meta',
  1022. 'type' => 'switch',
  1023. 'title' => esc_html__( 'Show author meta on single posts', 'seeko' ),
  1024. 'default' => '1',
  1025. 'section' => 'svq_section_blog',
  1026. 'description' => esc_html__( 'Show author meta under post title on single posts', 'seeko' ),
  1027. );
  1028.  
  1029. $sq['set']['svq_section_blog'][] = array(
  1030. 'id' => 'blog_nav',
  1031. 'type' => 'switch',
  1032. 'title' => esc_html__( 'Prev & Next articles', 'seeko' ),
  1033. 'default' => '1',
  1034. 'section' => 'svq_section_blog',
  1035. 'description' => esc_html__( 'Show previous and next articles on post header', 'seeko' ),
  1036. 'partial_refresh' => array(
  1037. 'blog_nav' => array(
  1038. 'selector' => '.svq-post-nav',
  1039. 'render_callback' => function() {
  1040. if ( svq_option( 'blog_nav', 1 ) ) {
  1041. svq_post_nav();
  1042. }
  1043. },
  1044. ),
  1045. ),
  1046. );
  1047.  
  1048. $sq['set']['svq_section_blog'][] = array(
  1049. 'id' => 'blog_author_bio',
  1050. 'type' => 'switch',
  1051. 'title' => esc_html__( 'Show author bio', 'seeko' ),
  1052. 'default' => '1',
  1053. 'section' => 'svq_section_blog',
  1054. 'description' => esc_html__( 'Show author details on single post page', 'seeko' ),
  1055. 'partial_refresh' => array(
  1056. 'blog_author_bio' => array(
  1057. 'selector' => '.author-bio',
  1058. 'render_callback' => function() {
  1059. if ( svq_option( 'blog_nav', 1 ) ) {
  1060. get_template_part( 'author-bio' );
  1061. }
  1062. },
  1063. ),
  1064. ),
  1065. );
  1066. $sq['set']['svq_section_blog'][] = array(
  1067. 'id' => 'blog_related',
  1068. 'type' => 'switch',
  1069. 'title' => esc_html__( 'Show related articles', 'seeko' ),
  1070. 'default' => '1',
  1071. 'section' => 'svq_section_blog',
  1072. 'description' => esc_html__( 'Show related posts on single post page', 'seeko' ),
  1073. );
  1074.  
  1075. $sq['set']['svq_section_blog'][] = array(
  1076. 'type' => 'custom',
  1077. 'id' => 'separator_blog_image',
  1078. 'default' => '<h4 class="customizer-separator">Image settings</h4>',
  1079. 'section' => 'svq_section_blog',
  1080. 'customizer' => true,
  1081. 'transport' => 'refresh'
  1082. );
  1083.  
  1084. //blog_get_image - switch
  1085. $sq['set']['svq_section_blog'][] = array(
  1086. 'id' => 'blog_get_image',
  1087. 'type' => 'switch',
  1088. 'title' => esc_html__( 'Get image from post content', 'seeko' ),
  1089. 'default' => '1',
  1090. 'section' => 'svq_section_blog',
  1091. 'description' => esc_html__( 'Shows on archive only. If no featured image was added, get it from the post content', 'seeko' ),
  1092. 'customizer' => true,
  1093. 'transport' => 'refresh'
  1094. );
  1095.  
  1096.  
  1097. //blog_default_image - image
  1098. $sq['set']['svq_section_blog'][] = array(
  1099. 'id' => 'blog_default_image',
  1100. 'type' => 'image',
  1101. 'title' => esc_html__( 'Default Post Image', 'seeko' ),
  1102. 'default' => '',
  1103. 'section' => 'svq_section_blog',
  1104. 'description' => esc_html__( 'Used when post has no featured image', 'seeko' ),
  1105. //'customizer' => true,
  1106. 'transport' => 'postMessage'
  1107. );
  1108.  
  1109. $sq['set']['svq_section_blog'][] = array(
  1110. 'id' => 'blog_default_image_format',
  1111. 'type' => 'select',
  1112. 'multiple' => 4,
  1113. 'choices' => [
  1114. 'standard' => 'Standard',
  1115. 'image' => 'Image',
  1116. 'gallery' => 'Gallery',
  1117. 'video' => 'Video',
  1118. 'quote' => 'Quote',
  1119. ],
  1120. 'title' => esc_html__( 'Default image post formats', 'seeko' ),
  1121. 'default' => [ 'image' ],
  1122. 'section' => 'svq_section_blog',
  1123. 'description' => esc_html__( 'Choose on what post formats to show the default image.', 'seeko' ),
  1124. //'customizer' => true,
  1125. //'transport' => 'postMessage',
  1126. );
  1127.  
  1128. //post_media_status
  1129. $sq['set']['svq_section_blog'][] = array(
  1130. 'id' => 'post_media_status',
  1131. 'type' => 'switch',
  1132. 'title' => esc_html__( 'Show featured image on post page', 'seeko' ),
  1133. 'default' => '1',
  1134. 'section' => 'svq_section_blog',
  1135. 'customizer' => true,
  1136. 'transport' => 'refresh'
  1137. );
  1138.  
  1139.  
  1140. //Footer
  1141.  
  1142.  
  1143. $sq['set']['svq_section_footer'][] = [
  1144. 'id' => 'footer_display',
  1145. 'title' => esc_html__( 'Footer Display Type', 'seeko' ),
  1146. 'type' => 'radio-buttonset',
  1147. 'default' => 'theme',
  1148. 'choices' => [
  1149. 'theme' => esc_html__( 'Theme Widgets', 'seeko' ),
  1150. 'elementor' => esc_html__( 'Elementor Template', 'seeko' ),
  1151. ],
  1152. 'section' => 'svq_section_footer',
  1153. ];
  1154.  
  1155. $el_query = [
  1156. 'post_type' => 'elementor_library',
  1157. 'meta_query' => [
  1158. [
  1159. 'key' => '_elementor_template_type',
  1160. 'value' => 'footer',
  1161. ],
  1162. ],
  1163. ];
  1164.  
  1165. $sq['set']['svq_section_footer'][] = [
  1166. 'id' => 'footer_el_tpl',
  1167. 'title' => esc_html__( 'Footer template', 'seeko' ),
  1168. 'type' => 'select',
  1169. 'default' => '',
  1170. 'choices' => [ '-' ] + Seeko_Customizer_Utils::get_select_pages( $el_query ),
  1171. 'section' => 'svq_section_footer',
  1172. 'active_callback' => array(
  1173. array(
  1174. 'setting' => 'footer_display',
  1175. 'operator' => '==',
  1176. 'value' => 'elementor',
  1177. ),
  1178. ),
  1179. ];
  1180.  
  1181. $sq['set']['svq_section_footer'][] = [
  1182. 'id' => 'footer_bg',
  1183. 'title' => esc_html__( 'Background', 'seeko' ),
  1184. 'type' => 'background',
  1185. 'default' => array(
  1186. 'background-color' => '#101010',
  1187. 'background-image' => get_template_directory_uri() . '/assets/img/footer-picture.png',
  1188. 'background-repeat' => 'no-repeat',
  1189. 'background-position' => 'center center',
  1190. 'background-size' => 'auto',
  1191. 'background-attachment' => 'scroll',
  1192. ),
  1193. 'output' => array(
  1194. array(
  1195. 'element' => '#footer .svq-footer-inner',
  1196. 'property' => 'background',
  1197. ),
  1198. ),
  1199. 'section' => 'svq_section_footer',
  1200. 'transport' => 'auto',
  1201. 'active_callback' => array(
  1202. array(
  1203. 'setting' => 'footer_display',
  1204. 'operator' => '!=',
  1205. 'value' => 'elementor',
  1206. ),
  1207. ),
  1208. ];
  1209.  
  1210. $sq['set']['svq_section_footer'][] = [
  1211. 'id' => 'footer_text',
  1212. 'title' => esc_html__( 'Text color', 'seeko' ),
  1213. 'type' => 'color',
  1214. 'default' => '#cccccc',
  1215. 'output' => array(
  1216. array(
  1217. 'element' => '#footer, #footer .widget_recent_comments ul li:before, #footer .widget_rss ul li .rsswidget:before',
  1218. 'property' => 'color',
  1219. ),
  1220. ),
  1221. 'section' => 'svq_section_footer',
  1222. 'transport' => 'auto',
  1223. 'active_callback' => array(
  1224. array(
  1225. 'setting' => 'footer_display',
  1226. 'operator' => '!=',
  1227. 'value' => 'elementor',
  1228. ),
  1229. ),
  1230. ];
  1231.  
  1232. $sq['set']['svq_section_footer'][] = [
  1233. 'id' => 'footer_heading',
  1234. 'title' => esc_html__( 'Headings color', 'seeko' ),
  1235. 'type' => 'color',
  1236. 'default' => '#ffffff',
  1237. 'output' => array(
  1238. array(
  1239. 'element' => '#footer h1, #footer h2, #footer h3, #footer h4, #footer h5, #footer h6',
  1240. 'property' => 'color',
  1241. ),
  1242. ),
  1243. 'section' => 'svq_section_footer',
  1244. 'transport' => 'auto',
  1245. 'active_callback' => array(
  1246. array(
  1247. 'setting' => 'footer_display',
  1248. 'operator' => '!=',
  1249. 'value' => 'elementor',
  1250. ),
  1251. ),
  1252. ];
  1253.  
  1254. $sq['set']['svq_section_footer'][] = [
  1255. 'id' => 'footer_link',
  1256. 'title' => esc_html__( 'Link color', 'seeko' ),
  1257. 'type' => 'color',
  1258. 'default' => '#efefef',
  1259. 'output' => array(
  1260. array(
  1261. 'element' => '#footer a:not(.bp-login-widget-register-link):not(.logout):not(.btn-tag)',
  1262. 'property' => 'color',
  1263. ),
  1264. array(
  1265. 'element' => '.svq-footer-socket a',
  1266. 'property' => 'color',
  1267. ),
  1268. ),
  1269. 'section' => 'svq_section_footer',
  1270. 'transport' => 'auto',
  1271. 'active_callback' => array(
  1272. array(
  1273. 'setting' => 'footer_display',
  1274. 'operator' => '!=',
  1275. 'value' => 'elementor',
  1276. ),
  1277. ),
  1278. ];
  1279.  
  1280. SVQ_FW::set_config( 'footer_copy_default', '' );
  1281.  
  1282. $sq['set']['svq_section_footer'][] = [
  1283. 'id' => 'footer_copy',
  1284. 'title' => esc_html__( 'Copyright text', 'seeko' ),
  1285. 'type' => 'editor',
  1286. 'default' => SVQ_FW::get_config( 'footer_copy_default' ),
  1287. 'section' => 'svq_section_footer',
  1288. 'transport' => 'auto',
  1289. 'active_callback' => array(
  1290. array(
  1291. 'setting' => 'footer_display',
  1292. 'operator' => '!=',
  1293. 'value' => 'elementor',
  1294. ),
  1295. ),
  1296. ];
  1297.  
  1298. $sq['set']['svq_section_footer'][] = [
  1299. 'id' => 'footer_socket_bg',
  1300. 'title' => esc_html__( 'Background Color', 'seeko' ),
  1301. 'type' => 'color',
  1302. 'default' => '#101010',
  1303. 'output' => array(
  1304. array(
  1305. 'element' => '.svq-footer-socket',
  1306. 'property' => 'background-color',
  1307. ),
  1308. ),
  1309. 'section' => 'svq_section_footer',
  1310. 'transport' => 'auto',
  1311. 'active_callback' => array(
  1312. array(
  1313. 'setting' => 'footer_display',
  1314. 'operator' => '!=',
  1315. 'value' => 'elementor',
  1316. ),
  1317. ),
  1318. ];
  1319. $sq['set']['svq_section_footer'][] = [
  1320. 'id' => 'footer_socket',
  1321. 'title' => esc_html__( 'Text color', 'seeko' ),
  1322. 'type' => 'color',
  1323. 'default' => '#cccccc',
  1324. 'output' => array(
  1325. array(
  1326. 'element' => '.svq-footer-socket',
  1327. 'property' => 'color',
  1328. ),
  1329. ),
  1330. 'section' => 'svq_section_footer',
  1331. 'transport' => 'auto',
  1332. 'active_callback' => array(
  1333. array(
  1334. 'setting' => 'footer_display',
  1335. 'operator' => '!=',
  1336. 'value' => 'elementor',
  1337. ),
  1338. ),
  1339. ];
  1340.  
  1341. $sq['set']['svq_section_footer'][] = [
  1342. 'id' => 'footer_copy_font_size',
  1343. 'title' => esc_html__( 'Copyright text size', 'seeko' ),
  1344. 'type' => 'seeko-input',
  1345. 'default' => [ 'mobile' => [ 'size' => '16', 'unit' => 'px' ] ],
  1346. 'units' => [ 'px', 'em', 'rem' ],
  1347. 'defaultUnit' => 'px',
  1348. 'section' => 'svq_section_footer',
  1349. 'transport' => 'postMessage',
  1350. 'responsive' => true,
  1351. 'output' => array(
  1352. array(
  1353. 'element' => '.svq-footer-socket',
  1354. 'property' => 'font-size',
  1355. ),
  1356. ),
  1357. 'active_callback' => array(
  1358. array(
  1359. 'setting' => 'footer_display',
  1360. 'operator' => '!=',
  1361. 'value' => 'elementor',
  1362. ),
  1363. ),
  1364. ];
  1365.  
  1366. return $sq;
  1367. }
  1368.  
  1369. /***************************************************
  1370. * :: Layout
  1371. ***************************************************/
  1372.  
  1373. SVQ_FW::set_config( 'site_layout_default', 'full' );
  1374. SVQ_FW::set_config( 'blog_layout_default', 'default' );
  1375. SVQ_FW::set_config( 'blog_archive_layout_default', 'default' );
  1376.  
  1377.  
  1378. if ( ! function_exists( 'svq_prepare_layout' ) ) {
  1379. /**
  1380. * Prepare site layout with different customizations
  1381. * @global string $svq_custom_logo
  1382. */
  1383. function svq_prepare_layout() {
  1384.  
  1385. //Change the template
  1386. $layout = svq_option( 'site_layout', SVQ_FW::get_config( 'site_layout_default' ) );
  1387.  
  1388. if ( is_single() ) {
  1389.  
  1390. if ( svq_option( 'blog_layout', SVQ_FW::get_config( 'blog_layout_default' ) ) == 'default' ) {
  1391. $layout = svq_option( 'site_layout', SVQ_FW::get_config( 'site_layout_default' ) );
  1392. } else {
  1393. $layout = svq_option( 'blog_layout', SVQ_FW::get_config( 'blog_layout_default' ) );
  1394. }
  1395.  
  1396. } elseif ( is_archive() ) {
  1397. if ( svq_option( 'blog_archive_layout', SVQ_FW::get_config( 'blog_archive_layout_default' ) ) == 'default' ) {
  1398. $layout = svq_option( 'site_layout', SVQ_FW::get_config( 'site_layout_default' ) );
  1399. } else {
  1400. $layout = svq_option( 'blog_archive_layout', SVQ_FW::get_config( 'blog_archive_layout_default' ) );
  1401. }
  1402.  
  1403. }
  1404. $layout = apply_filters( 'site_layout', $layout );
  1405. svq_apply_layout( $layout );
  1406.  
  1407. }
  1408. }
  1409.  
  1410. function svq_switch_layout( $layout ) {
  1411. add_filter( 'site_layout', function () use ( $layout ) {
  1412.  
  1413. return $layout;
  1414. } );
  1415. }
  1416.  
  1417. add_action( 'wp_head', 'svq_prepare_layout' );
  1418.  
  1419.  
  1420. /***************************************************
  1421. * :: Sidebar logic
  1422. ***************************************************/
  1423. if ( ! function_exists( 'svq_apply_layout' ) ) {
  1424. /**
  1425. * Change site layout
  1426. *
  1427. * @param bool $layout
  1428. * @param int $priority
  1429. */
  1430. function svq_apply_layout( $layout = false, $priority = 10 ) {
  1431. if ( $layout == false ) {
  1432. $layout = svq_option( 'site_layout', SVQ_FW::get_config( 'site_layout_default' ) );
  1433. }
  1434.  
  1435. if ( 'left' == $layout || 'right' == $layout ) {
  1436.  
  1437. add_filter( 'svq_main_row_class', function ( $classes ) use ( $layout ) {
  1438. if ( is_single() ) {
  1439. $classes['layout'] = 'layout-custom';
  1440. } else {
  1441. $classes['layout'] = 'layout';
  1442. }
  1443. $classes['sidebar'] = 'sidebar-' . $layout;
  1444.  
  1445. return $classes;
  1446. } );
  1447. add_action( 'svq_after_content', 'svq_sidebar', $priority );
  1448.  
  1449. } elseif ( 'full' == $layout || 'no' == $layout || 'default' == $layout ) {
  1450.  
  1451. remove_action( 'svq_after_content', 'svq_sidebar' );
  1452. }
  1453.  
  1454. $body_class = 'tpl-' . $layout;
  1455. add_filter( 'body_class', function ( $classes ) use ( $body_class ) {
  1456. $classes['tpl'] = $body_class;
  1457.  
  1458. return $classes;
  1459. } );
  1460.  
  1461. SVQ_FW::set_config( 'current_layout', $layout );
  1462.  
  1463. do_action( 'svq_apply_layout', $layout );
  1464. }
  1465. }
  1466.  
  1467. //get the global sidebar
  1468. if ( ! function_exists( 'svq_sidebar' ) ):
  1469. function svq_sidebar() {
  1470. get_sidebar();
  1471. }
  1472. endif;
  1473.  
  1474.  
  1475. /***************************************************
  1476. * :: Main section functions
  1477. ***************************************************/
  1478.  
  1479.  
  1480. /**
  1481. * Display the classes for the main section.
  1482. *
  1483. * @since 1.0
  1484. *
  1485. * @param string|array $class One or more classes to add to the class list.
  1486. */
  1487. function svq_main_section_class( $class = '' ) {
  1488. // Separates classes with a single space, collates classes for body element
  1489. echo 'class="' . join( ' ', svq_get_main_section_class( $class ) ) . '"';
  1490. }
  1491.  
  1492. /**
  1493. * Retrieve the classes for the menu element as an array.
  1494. *
  1495. * @since 1.0
  1496. *
  1497. * @param string|array $class One or more classes to add to the class list.
  1498. *
  1499. * @return array Array of classes.
  1500. */
  1501. function svq_get_main_section_class( $class = '' ) {
  1502.  
  1503. $classes = array( 'content-wrapper', SVQ_FW::get_config( 'container_class' ) );
  1504. if ( svq_has_shortcode( 'svq_bp_' ) ) {
  1505. $classes[] = 'buddypress';
  1506. }
  1507.  
  1508. if ( ! empty( $class ) ) {
  1509. if ( ! is_array( $class ) ) {
  1510. $class = preg_split( '#\s+#', $class );
  1511. }
  1512. $classes = array_merge( $classes, $class );
  1513. } else {
  1514. // Ensure that we always coerce class to being an array.
  1515. $class = array();
  1516. }
  1517.  
  1518. $classes = apply_filters( 'svq_main_section_class', $classes, $class );
  1519.  
  1520. return array_unique( $classes );
  1521. }
  1522.  
  1523. /**
  1524. * Display the classes for the main row.
  1525. *
  1526. * @since 1.0
  1527. *
  1528. * @param string|array $class One or more classes to add to the class list.
  1529. */
  1530. function svq_main_row_class( $class = '' ) {
  1531. // Separates classes with a single space, collates classes for body element
  1532. echo 'class="' . join( ' ', svq_get_main_row_class( $class ) ) . '"';
  1533. }
  1534.  
  1535. /**
  1536. * Retrieve the classes for the main row.
  1537. *
  1538. * @since 1.0
  1539. *
  1540. * @param string|array $class One or more classes to add to the class list.
  1541. *
  1542. * @return array Array of classes.
  1543. */
  1544. function svq_get_main_row_class( $class = '' ) {
  1545.  
  1546. $classes = [ 'row' ];
  1547. //$classes['layout'] = 'layout';
  1548. if ( ! empty( $class ) ) {
  1549. if ( ! is_array( $class ) ) {
  1550. $class = preg_split( '#\s+#', $class );
  1551. }
  1552. $classes = array_merge( $classes, $class );
  1553. } else {
  1554. // Ensure that we always coerce class to being an array.
  1555. $class = array();
  1556. }
  1557.  
  1558. $classes = apply_filters( 'svq_main_row_class', $classes, $class );
  1559.  
  1560. return array_unique( $classes );
  1561. }
  1562.  
  1563.  
  1564. /**
  1565. * Display the classes for the main column.
  1566. *
  1567. * @since 1.0
  1568. *
  1569. * @param string|array $class One or more classes to add to the class list.
  1570. */
  1571. function svq_main_col_class( $class = '' ) {
  1572. // Separates classes with a single space, collates classes for body element
  1573. echo 'class="' . join( ' ', svq_get_main_col_class( $class ) ) . '"';
  1574. }
  1575.  
  1576. /**
  1577. * Retrieve the classes for the main row.
  1578. *
  1579. * @since 1.0
  1580. *
  1581. * @param string|array $class One or more classes to add to the class list.
  1582. *
  1583. * @return array Array of classes.
  1584. */
  1585. function svq_get_main_col_class( $class = '' ) {
  1586.  
  1587. $classes = [ 'col-main' ];
  1588. $classes['col'] = 'col-12';
  1589.  
  1590. if ( ! empty( $class ) ) {
  1591. if ( ! is_array( $class ) ) {
  1592. $class = preg_split( '#\s+#', $class );
  1593. }
  1594. $classes = array_merge( $classes, $class );
  1595. } else {
  1596. // Ensure that we always coerce class to being an array.
  1597. $class = array();
  1598. }
  1599.  
  1600. $classes = apply_filters( 'svq_main_col_class', $classes, $class );
  1601.  
  1602. return array_unique( $classes );
  1603. }
  1604.  
  1605. /***************************************************
  1606. * :: SIDEBAR section functions
  1607. ***************************************************/
  1608.  
  1609.  
  1610. /**
  1611. * Display the classes for the main section.
  1612. *
  1613. * @since 1.0
  1614. *
  1615. * @param string|array $class One or more classes to add to the class list.
  1616. */
  1617. function svq_sidebar_class( $class = '' ) {
  1618. // Separates classes with a single space, collates classes for body element
  1619. echo 'class="' . join( ' ', svq_get_sidebar_class( $class ) ) . '"';
  1620. }
  1621.  
  1622. /**
  1623. * Retrieve the classes for the menu element as an array.
  1624. *
  1625. * @since 1.0
  1626. *
  1627. * @param string|array $class One or more classes to add to the class list.
  1628. *
  1629. * @return array Array of classes.
  1630. */
  1631. function svq_get_sidebar_class( $class = '' ) {
  1632.  
  1633. $classes = array();
  1634.  
  1635. if ( ! empty( $class ) ) {
  1636. if ( ! is_array( $class ) ) {
  1637. $class = preg_split( '#\s+#', $class );
  1638. }
  1639. $classes = array_merge( $classes, $class );
  1640. } else {
  1641. // Ensure that we always coerce class to being an array.
  1642. $class = array();
  1643. }
  1644.  
  1645. $classes = apply_filters( 'svq_sidebar_class', $classes, $class );
  1646.  
  1647. return array_unique( $classes );
  1648. }
  1649.  
  1650.  
  1651. if ( ! function_exists( 'svq_post_thumbnail_html_fallback' ) ) {
  1652. /**
  1653. * Get the Featured image URL of a post.
  1654. *
  1655. * @param $html
  1656. * @param $post_id
  1657. * @param $post_thumbnail_id
  1658. * @param $size
  1659. * @param $attr
  1660. *
  1661. * @return string
  1662. */
  1663. function svq_post_thumbnail_html_fallback( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
  1664.  
  1665. if ( $html == '' ) {
  1666.  
  1667. global $post;
  1668. if ( ! is_object( $post ) && $post_id != null ) {
  1669. $post = setup_postdata( get_post( $post_id ) );
  1670. }
  1671. ob_start();
  1672. ob_end_clean();
  1673.  
  1674. $post_format = get_post_format( $post );
  1675. if ( $post_format == false ) {
  1676. $post_format = 'standard';
  1677. }
  1678. if ( svq_option( 'blog_get_image', 1 ) == 1 ) {
  1679.  
  1680. if ( ! is_single() && isset( $post->post_content ) ) {
  1681.  
  1682. preg_match_all( '|<img.*?src=[\'"](.*?)[\'"].*?>|i', $post->post_content, $matches );
  1683. $image_url = isset( $matches[1][0] ) ? $matches[1][0] : null;
  1684. if ( $image_id = attachment_url_to_postid( strtok( $image_url, '?' ) ) ) {
  1685. $html = wp_get_attachment_image( $image_id, $size, false, $attr );
  1686.  
  1687. return $html;
  1688. }
  1689. }
  1690. }
  1691.  
  1692. $image_url = svq_option_url( 'blog_default_image', '' );
  1693.  
  1694. if ( is_string( $image_url ) && $image_id = attachment_url_to_postid( strtok( $image_url, '?' ) ) ) {
  1695.  
  1696. if ( in_array( $post_format, svq_option( 'blog_default_image_format' ) ) ) {
  1697. $html = wp_get_attachment_image( $image_id, $size, false, $attr );
  1698.  
  1699. return $html;
  1700. }
  1701. }
  1702. }
  1703.  
  1704. return $html;
  1705.  
  1706. }
  1707.  
  1708. add_filter( 'post_thumbnail_html', 'svq_post_thumbnail_html_fallback', 12, 5 );
  1709. }
  1710.  
  1711.  
  1712. add_filter( 'the_content', 'svq_quote_content' );
  1713. /**
  1714. * Replace blockquote
  1715. *
  1716. * @param $content
  1717. *
  1718. * @return mixed|string
  1719. */
  1720. function svq_quote_content( $content ) {
  1721.  
  1722. /* Check if we're displaying a 'quote' post. */
  1723. if ( has_post_format( 'quote' ) ) {
  1724.  
  1725. /* Match any <blockquote> elements. */
  1726. preg_match( '/<blockquote.*?>/', $content, $matches );
  1727.  
  1728. /* If no <blockquote> elements were found, wrap the entire content in one. */
  1729. if ( empty( $matches ) ) {
  1730. if ( is_single() ) {
  1731. $content = "<div class='quote-highlight'><blockquote>{$content}</blockquote></div>";
  1732. } else {
  1733. $content = "<blockquote>{$content}</blockquote>";
  1734. }
  1735. } else {
  1736. if ( is_single() ) {
  1737. $content = preg_replace('/<blockquote/', '<div class="quote-highlight"><blockquote', $content, 1);
  1738. $content = preg_replace('/<\/blockquote>/', '</blockquote></div>', $content, 1);
  1739. }
  1740. }
  1741.  
  1742. }
  1743.  
  1744. return $content;
  1745. }
  1746.  
  1747. function svq_get_content_quote( $content ) {
  1748. preg_match( '/<blockquote(.*?)>(.|\n)*?<\/blockquote>/i', $content, $matches );
  1749. if ( isset( $matches[0] ) ) {
  1750. if (strpos($matches[0], 'class=') !== false) {
  1751. return str_replace( 'class="', 'class="h4 ', $matches[0] );
  1752. } else {
  1753. return str_replace( '<blockquote', '<blockquote class="h4"', $matches[0] );
  1754. }
  1755.  
  1756. }
  1757.  
  1758. return '';
  1759. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement