Changeset 1559127
- Timestamp:
- 12/21/2016 04:17:22 PM (9 years ago)
- Location:
- advanced-twenty-seventeen/trunk
- Files:
-
- 4 edited
-
advanced-twenty-seventeen.php (modified) (3 diffs)
-
inc/admin/child-theme/style.css (modified) (1 diff)
-
inc/class-ats-customizer.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-twenty-seventeen/trunk/advanced-twenty-seventeen.php
r1558751 r1559127 4 4 * Plugin URI: https://saturnthemes.com/ 5 5 * Description: An toolkit that helps you customize the Twenty Seventeen theme completely. 6 * Version: 1. 0.06 * Version: 1.1.0 7 7 * Author: saturnplugins 8 8 * Author URI: https://saturnthemes.com … … 19 19 if ( ! class_exists( 'AdvancedTwentySeventeen' ) ) { 20 20 class AdvancedTwentySeventeen { 21 public $version = '1. 0.0';21 public $version = '1.1.0'; 22 22 23 23 protected static $_instance = null; … … 48 48 49 49 public function includes() { 50 if ( $this->is_request( 'admin' ) ) { 50 include_once( 'inc/libraries/kirki/kirki.php' ); 51 52 if ( $this->is_request( 'admin' ) ) { 51 53 include_once( 'inc/admin/class-ats-admin.php' ); 52 54 } -
advanced-twenty-seventeen/trunk/inc/admin/child-theme/style.css
r1558751 r1559127 36 36 margin-right: auto; 37 37 } 38 39 @media (max-width: 1170px) { 40 .ats-preview.ats-layout-boxed #page, 41 .ats-preview.ats-layout-boxed .site-navigation-fixed { 42 max-width: 960px; 43 } 44 } -
advanced-twenty-seventeen/trunk/inc/class-ats-customizer.php
r1558751 r1559127 7 7 class ATS_Customizer { 8 8 public function __construct() { 9 add_action( 'customize_register', array( $this, 'register_settings' ) ); 10 add_action( 'customize_preview_init', array( $this, 'preview_js' ) ); 11 add_action( 'wp_head', array( $this, 'generate_css' ) ); 9 Kirki::add_config( 'ats', array( 10 'capability' => 'edit_theme_options', 11 'option_type' => 'theme_mod', 12 ) ); 13 14 $panel_priority = 9999; 15 $section_priority = 10; 16 $control_priority = 10; 17 18 Kirki::add_panel( 'ats_global_panel', array( 19 'priority' => $panel_priority++, 20 'title' => __( 'Advanced: Global', 'textdomain' ), 21 ) ); 22 23 Kirki::add_panel( 'ats_header_panel', array( 24 'priority' => $panel_priority++, 25 'title' => __( 'Advanced: Header', 'textdomain' ), 26 ) ); 27 28 Kirki::add_panel( 'ats_footer_panel', array( 29 'priority' => $panel_priority++, 30 'title' => __( 'Advanced: Footer', 'textdomain' ), 31 ) ); 32 33 Kirki::add_panel( 'ats_miscellaneous_panel', array( 34 'priority' => $panel_priority++, 35 'title' => __( 'Advanced: Miscellaneous', 'textdomain' ), 36 ) ); 37 38 Kirki::add_section( 'ats_general_section', array( 39 'title' => __( 'General', 'advanced-twenty-seventeen' ), 40 'panel' => 'ats_global_panel', 41 'priority' => $section_priority++, 42 ) ); 43 44 Kirki::add_section( 'ats_layout_section', array( 45 'title' => __( 'Layout', 'advanced-twenty-seventeen' ), 46 'panel' => 'ats_global_panel', 47 'priority' => $section_priority++, 48 ) ); 49 50 Kirki::add_section( 'ats_header_general_section', array( 51 'title' => __( 'General', 'advanced-twenty-seventeen' ), 52 'panel' => 'ats_header_panel', 53 'priority' => $section_priority++, 54 ) ); 55 56 Kirki::add_section( 'ats_branding_section', array( 57 'title' => __( 'Site Branding', 'advanced-twenty-seventeen' ), 58 'panel' => 'ats_header_panel', 59 'priority' => $section_priority++, 60 ) ); 61 62 Kirki::add_section( 'ats_menu_section', array( 63 'title' => __( 'Menu', 'advanced-twenty-seventeen' ), 64 'panel' => 'ats_header_panel', 65 'priority' => $section_priority++, 66 ) ); 67 68 Kirki::add_section( 'ats_footer_copyright_section', array( 69 'title' => __( 'Custom Copyright', 'advanced-twenty-seventeen' ), 70 'panel' => 'ats_footer_panel', 71 'priority' => $section_priority++, 72 ) ); 73 74 Kirki::add_section( 'ats_custom_code_section', array( 75 'title' => __( 'Custom Code', 'advanced-twenty-seventeen' ), 76 'panel' => 'ats_miscellaneous_panel', 77 'priority' => $section_priority++, 78 ) ); 79 80 Kirki::add_field( 'ats', array( 81 'settings' => 'ats_site_layout', 82 'label' => __( 'Layout', 'translation_domain' ), 83 'section' => 'ats_general_section', 84 'type' => 'select', 85 'choices' => array( 86 'full_width' => __( 'Full Width', 'advanced-twenty-seventeen' ), 87 'boxed' => __( 'Boxed', 'advanced-twenty-seventeen' ), 88 ), 89 'default' => 'left top', 90 'priority' => $control_priority++, 91 'transport' => 'refresh', 92 ) ); 93 94 Kirki::add_field( 'ats', array( 95 'settings' => 'ats_general_background_image', 96 'label' => __( 'Background Image', 'translation_domain' ), 97 'section' => 'ats_general_section', 98 'type' => 'image', 99 'priority' => $control_priority++, 100 'description' => __( 'To use this option properly please go to Customizer > Header Media > click on Hide Image of Header Image.', 'advanced-twenty-seventeen' ), 101 'output' => array( 102 array( 103 'element' => 'body', 104 'property' => 'background-image', 105 ), 106 ), 107 'active_callback' => array( 108 array( 109 'setting' => 'ats_site_layout', 110 'operator' => '==', 111 'value' => 'boxed', 112 ), 113 ), 114 ) ); 115 116 Kirki::add_field( 'ats', array( 117 'settings' => 'ats_general_background_repeat', 118 'label' => __( 'Background Repeat', 'translation_domain' ), 119 'section' => 'ats_general_section', 120 'type' => 'select', 121 'choices' => $this->choice_background_repeat(), 122 'default' => 'no-repeat', 123 'priority' => $control_priority++, 124 'transport' => 'auto', 125 'output' => array( 126 array( 127 'element' => 'body', 128 'property' => 'background-repeat', 129 ), 130 ), 131 'active_callback' => array( 132 array( 133 'setting' => 'ats_site_layout', 134 'operator' => '==', 135 'value' => 'boxed', 136 ), 137 ), 138 ) ); 139 140 Kirki::add_field( 'ats', array( 141 'settings' => 'ats_general_background_position', 142 'label' => __( 'Background Position', 'translation_domain' ), 143 'section' => 'ats_general_section', 144 'type' => 'select', 145 'choices' => $this->choice_background_position(), 146 'default' => 'left top', 147 'priority' => $control_priority++, 148 'transport' => 'auto', 149 'output' => array( 150 array( 151 'element' => 'body', 152 'property' => 'background-position', 153 ), 154 ), 155 'active_callback' => array( 156 array( 157 'setting' => 'ats_site_layout', 158 'operator' => '==', 159 'value' => 'boxed', 160 ), 161 ), 162 ) ); 163 164 Kirki::add_field( 'ats', array( 165 'settings' => 'ats_general_background_attachment', 166 'label' => __( 'Background Attachment', 'translation_domain' ), 167 'section' => 'ats_general_section', 168 'type' => 'select', 169 'choices' => $this->choice_background_attachment(), 170 'default' => '', 171 'priority' => $control_priority++, 172 'transport' => 'auto', 173 'output' => array( 174 array( 175 'element' => 'body', 176 'property' => 'background-attachment', 177 ), 178 ), 179 'active_callback' => array( 180 array( 181 'setting' => 'ats_site_layout', 182 'operator' => '==', 183 'value' => 'boxed', 184 ), 185 ), 186 ) ); 187 188 Kirki::add_field( 'ats', array( 189 'settings' => 'ats_general_background_color', 190 'label' => __( 'Background Color', 'translation_domain' ), 191 'section' => 'ats_general_section', 192 'type' => 'color', 193 'default' => '', 194 'priority' => $control_priority++, 195 'transport' => 'auto', 196 'output' => array( 197 array( 198 'element' => 'body', 199 'property' => 'background-color', 200 ), 201 ), 202 'active_callback' => array( 203 array( 204 'setting' => 'ats_site_layout', 205 'operator' => '==', 206 'value' => 'boxed', 207 ), 208 ), 209 ) ); 210 211 Kirki::add_field( 'ats', array( 212 'settings' => 'ats_general_color', 213 'label' => __( 'Text Color', 'translation_domain' ), 214 'section' => 'ats_general_section', 215 'type' => 'color', 216 'default' => '', 217 'priority' => $control_priority++, 218 'transport' => 'auto', 219 'output' => array( 220 array( 221 'element' => 'body', 222 'property' => 'color', 223 ), 224 ), 225 ) ); 226 227 Kirki::add_field( 'ats', array( 228 'settings' => 'ats_general_cats_general_heading_colorolor', 229 'label' => __( 'Heading Color', 'translation_domain' ), 230 'section' => 'ats_general_section', 231 'type' => 'color', 232 'default' => '', 233 'priority' => $control_priority++, 234 'transport' => 'auto', 235 'output' => array( 236 array( 237 'element' => 'h1, h2, h3, h4, h5, h6', 238 'property' => 'color', 239 ), 240 ), 241 ) ); 242 243 Kirki::add_field( 'ats', array( 244 'settings' => 'ats_general_link_color', 245 'label' => __( 'Link Color', 'translation_domain' ), 246 'section' => 'ats_general_section', 247 'type' => 'color', 248 'default' => '', 249 'priority' => $control_priority++, 250 'transport' => 'auto', 251 'output' => array( 252 array( 253 'element' => 'a', 254 'property' => 'color', 255 ), 256 ), 257 ) ); 258 259 Kirki::add_field( 'ats', array( 260 'settings' => 'ats_general_link_color_hover', 261 'label' => __( 'Link Color on Hover', 'translation_domain' ), 262 'section' => 'ats_general_section', 263 'type' => 'color', 264 'default' => '', 265 'priority' => $control_priority++, 266 'transport' => 'auto', 267 'output' => array( 268 array( 269 'element' => 'a:hover', 270 'property' => 'color', 271 ), 272 ), 273 ) ); 274 275 Kirki::add_field( 'ats', array( 276 'settings' => 'ats_header_background_image', 277 'label' => __( 'Background Image', 'translation_domain' ), 278 'section' => 'ats_header_general_section', 279 'type' => 'image', 280 'priority' => $control_priority++, 281 'description' => __( 'To use this option properly please go to Customizer > Header Media > click on Hide Image of Header Image.', 'advanced-twenty-seventeen' ), 282 'output' => array( 283 array( 284 'element' => '.site-header', 285 'property' => 'background-image', 286 ), 287 ), 288 ) ); 289 290 Kirki::add_field( 'ats', array( 291 'settings' => 'ats_header_background_repeat', 292 'label' => __( 'Background Repeat', 'translation_domain' ), 293 'section' => 'ats_header_general_section', 294 'type' => 'select', 295 'choices' => $this->choice_background_repeat(), 296 'default' => 'no-repeat', 297 'priority' => $control_priority++, 298 'transport' => 'auto', 299 'output' => array( 300 array( 301 'element' => '.site-header', 302 'property' => 'background-repeat', 303 ), 304 ), 305 ) ); 306 307 Kirki::add_field( 'ats', array( 308 'settings' => 'ats_header_background_position', 309 'label' => __( 'Background Position', 'translation_domain' ), 310 'section' => 'ats_header_general_section', 311 'type' => 'select', 312 'choices' => $this->choice_background_position(), 313 'default' => 'left top', 314 'priority' => $control_priority++, 315 'transport' => 'auto', 316 'output' => array( 317 array( 318 'element' => '.site-header', 319 'property' => 'background-position', 320 ), 321 ), 322 ) ); 323 324 Kirki::add_field( 'ats', array( 325 'settings' => 'ats_header_background_attachment', 326 'label' => __( 'Background Attachment', 'translation_domain' ), 327 'section' => 'ats_header_general_section', 328 'type' => 'select', 329 'choices' => $this->choice_background_attachment(), 330 'default' => '', 331 'priority' => $control_priority++, 332 'transport' => 'auto', 333 'output' => array( 334 array( 335 'element' => '.site-header', 336 'property' => 'background-attachment', 337 ), 338 ), 339 ) ); 340 341 Kirki::add_field( 'ats', array( 342 'settings' => 'ats_header_background_color', 343 'label' => __( 'Background Color', 'translation_domain' ), 344 'section' => 'ats_header_general_section', 345 'type' => 'color', 346 'default' => '', 347 'priority' => $control_priority++, 348 'transport' => 'auto', 349 'output' => array( 350 array( 351 'element' => '.site-header', 352 'property' => 'background-color', 353 ), 354 ), 355 ) ); 356 357 Kirki::add_field( 'ats', array( 358 'settings' => 'ats_branding_align', 359 'label' => __( 'Align', 'translation_domain' ), 360 'section' => 'ats_branding_section', 361 'type' => 'select', 362 'choices' => array( 363 'left' => __( 'Left', 'advanced-twenty-seventeen' ), 364 'center' => __( 'Center', 'advanced-twenty-seventeen' ), 365 'right' => __( 'Right', 'advanced-twenty-seventeen' ), 366 ), 367 'description' => __( 'Horizontal align for site branding', 'advanced-twenty-seventeen' ), 368 'default' => 'left', 369 'priority' => $control_priority++, 370 'transport' => 'refresh', 371 ) ); 372 373 Kirki::add_field( 'ats', array( 374 'type' => 'typography', 375 'settings' => 'ats_header_site_title_typography', 376 'label' => esc_attr__( 'Site Title', 'kirki' ), 377 'section' => 'ats_branding_section', 378 'default' => array( 379 'font-family' => 'Libre Franklin', 380 'variant' => '800', 381 'font-size' => '36px', 382 'letter-spacing' => '0.08em', 383 'subsets' => array( 'latin-ext' ), 384 'color' => '#fff', 385 'text-transform' => 'uppercase', 386 ), 387 'priority' => $control_priority++, 388 'output' => array( 389 array( 390 'element' => '.site-branding .site-branding-text .site-title, .site-branding .site-branding-text .site-title, .site-branding .site-branding-text .site-title, .site-branding .site-branding-text .site-title a', 391 ), 392 ), 393 ) ); 394 395 Kirki::add_field( 'ats', array( 396 'type' => 'typography', 397 'settings' => 'ats_header_site_description', 398 'label' => esc_attr__( 'Site Description', 'kirki' ), 399 'section' => 'ats_branding_section', 400 'default' => array( 401 'font-family' => 'Libre Franklin', 402 'variant' => '400', 403 'font-size' => '16px', 404 'letter-spacing' => '0em', 405 'subsets' => array( 'latin-ext' ), 406 'color' => '#fff', 407 'text-transform' => 'none', 408 ), 409 'priority' => $control_priority++, 410 'output' => array( 411 array( 412 'element' => '.site-branding .site-branding-text .site-description', 413 ), 414 ), 415 ) ); 416 417 Kirki::add_field( 'ats', array( 418 'settings' => 'ats_menu_align', 419 'label' => __( 'Align', 'translation_domain' ), 420 'section' => 'ats_menu_section', 421 'type' => 'select', 422 'choices' => array( 423 'left' => __( 'Left', 'advanced-twenty-seventeen' ), 424 'center' => __( 'Center', 'advanced-twenty-seventeen' ), 425 'right' => __( 'Right', 'advanced-twenty-seventeen' ), 426 ), 427 'description' => __( 'Horizontal align for menu', 'advanced-twenty-seventeen' ), 428 'default' => 'left', 429 'priority' => $control_priority++, 430 'transport' => 'auto', 431 'output' => array( 432 array( 433 'element' => '.navigation-top .menu', 434 'property' => 'text-align' 435 ), 436 ), 437 ) ); 438 439 Kirki::add_field( 'ats', array( 440 'settings' => 'ats_menu_background_image', 441 'label' => __( 'Background Image', 'translation_domain' ), 442 'section' => 'ats_menu_section', 443 'type' => 'image', 444 'priority' => $control_priority++, 445 'output' => array( 446 array( 447 'element' => '.navigation-top', 448 'property' => 'background-image', 449 ), 450 ), 451 ) ); 452 453 Kirki::add_field( 'ats', array( 454 'settings' => 'ats_menu_background_repeat', 455 'label' => __( 'Background Repeat', 'translation_domain' ), 456 'section' => 'ats_menu_section', 457 'type' => 'select', 458 'choices' => $this->choice_background_repeat(), 459 'default' => 'no-repeat', 460 'priority' => $control_priority++, 461 'transport' => 'auto', 462 'output' => array( 463 array( 464 'element' => '.navigation-top', 465 'property' => 'background-repeat', 466 ), 467 ), 468 ) ); 469 470 Kirki::add_field( 'ats', array( 471 'settings' => 'ats_menu_background_position', 472 'label' => __( 'Background Position', 'translation_domain' ), 473 'section' => 'ats_menu_section', 474 'type' => 'select', 475 'choices' => $this->choice_background_position(), 476 'default' => 'left top', 477 'priority' => $control_priority++, 478 'transport' => 'auto', 479 'output' => array( 480 array( 481 'element' => '.navigation-top', 482 'property' => 'background-position', 483 ), 484 ), 485 ) ); 486 487 Kirki::add_field( 'ats', array( 488 'settings' => 'ats_menu_background_attachment', 489 'label' => __( 'Background Attachment', 'translation_domain' ), 490 'section' => 'ats_menu_section', 491 'type' => 'select', 492 'choices' => $this->choice_background_attachment(), 493 'default' => '', 494 'priority' => $control_priority++, 495 'transport' => 'auto', 496 'output' => array( 497 array( 498 'element' => '.navigation-top', 499 'property' => 'background-attachment', 500 ), 501 ), 502 ) ); 503 504 Kirki::add_field( 'ats', array( 505 'settings' => 'ats_menu_background_color', 506 'label' => __( 'Background Color', 'translation_domain' ), 507 'section' => 'ats_menu_section', 508 'type' => 'color', 509 'default' => '', 510 'priority' => $control_priority++, 511 'transport' => 'auto', 512 'output' => array( 513 array( 514 'element' => '.navigation-top', 515 'property' => 'background-color', 516 ), 517 ), 518 ) ); 519 520 Kirki::add_field( 'ats', array( 521 'settings' => 'ats_menu_border_top', 522 'label' => __( 'Border Top', 'translation_domain' ), 523 'section' => 'ats_menu_section', 524 'type' => 'textfield', 525 'default' => '1px solid #eee', 526 'priority' => $control_priority++, 527 'transport' => 'auto', 528 'description' => __( 'For example: 1px solid #eee or none', 'advanced-twenty-seventeen' ), 529 'output' => array( 530 array( 531 'element' => '.navigation-top', 532 'property' => 'border-top', 533 ), 534 ), 535 ) ); 536 537 Kirki::add_field( 'ats', array( 538 'settings' => 'ats_menu_border_bottom', 539 'label' => __( 'Border Bottom', 'translation_domain' ), 540 'section' => 'ats_menu_section', 541 'type' => 'textfield', 542 'default' => '1px solid #eee', 543 'priority' => $control_priority++, 544 'transport' => 'auto', 545 'description' => __( 'For example: 1px solid #eee or none', 'advanced-twenty-seventeen' ), 546 'output' => array( 547 array( 548 'element' => '.navigation-top', 549 'property' => 'border-bottom', 550 ), 551 ), 552 ) ); 553 554 Kirki::add_field( 'ats', array( 555 'type' => 'typography', 556 'settings' => 'ats_menu_item', 557 'label' => esc_attr__( 'Menu Item', 'kirki' ), 558 'section' => 'ats_menu_section', 559 'default' => array( 560 'font-family' => 'Libre Franklin', 561 'variant' => '600', 562 'font-size' => '0.875rem', 563 'letter-spacing' => '0em', 564 'subsets' => array( 'latin-ext' ), 565 'color' => '#222', 566 'text-transform' => 'none', 567 ), 568 'transport' => 'auto', 569 'priority' => $control_priority++, 570 'output' => array( 571 array( 572 'element' => '.navigation-top .menu > .menu-item > a', 573 ), 574 ), 575 ) ); 576 577 Kirki::add_field( 'ats', array( 578 'type' => 'typography', 579 'settings' => 'ats_menu_item_hover', 580 'label' => esc_attr__( 'Menu Item', 'kirki' ), 581 'section' => 'ats_menu_section', 582 'default' => array( 583 'font-family' => 'Libre Franklin', 584 'variant' => '600', 585 'font-size' => '0.875rem', 586 'letter-spacing' => '0em', 587 'subsets' => array( 'latin-ext' ), 588 'color' => '#767676', 589 'text-transform' => 'none', 590 ), 591 'transport' => 'refresh', 592 'priority' => $control_priority++, 593 'output' => array( 594 array( 595 'element' => '.main-navigation .menu > .menu-item > a:hover, .navigation-top .current-menu-item > a, .navigation-top .current_page_item > a', 596 ), 597 ), 598 ) ); 599 600 Kirki::add_field( 'ats', array( 601 'settings' => 'ats_custom_copyright', 602 'label' => __( 'Custom Copyright', 'translation_domain' ), 603 'section' => 'ats_footer_copyright_section', 604 'type' => 'textarea', 605 'default' => __( 'Proudly powered by WordPress', 'advanced-twenty-seventeen' ), 606 'priority' => $control_priority++, 607 'transport' => 'refresh', 608 ) ); 609 610 Kirki::add_field( 'ats', array( 611 'settings' => 'ats_custom_code', 612 'label' => __( 'Custom Code', 'translation_domain' ), 613 'section' => 'ats_custom_code_section', 614 'type' => 'code', 615 'default' => __( '<!-- Your Custom HTML Code -->', 'advanced-twenty-seventeen' ), 616 'priority' => $control_priority++, 617 'transport' => 'refresh', 618 'choices' => array( 619 'language' => '', 620 'theme' => 'monokai', 621 'height' => 250, 622 ), 623 ) ); 624 12 625 add_action( 'wp_footer', array( $this, 'wp_footer' ) ); 13 626 add_filter( 'body_class', array( $this, 'body_class' ) ); 14 }15 16 public function register_settings( $wp_customize ) {17 $panel_priority = 9999;18 $section_priority = 10;19 $control_priority = 10;20 21 // Section Global22 $wp_customize->add_panel( 'ats_global_panel', array(23 'title' => __( 'Advanced: Global', 'advanced-twenty-seventeen' ),24 'priority' => $panel_priority++,25 ) );26 27 $wp_customize->add_section( 'ats_general_section', array(28 'title' => __( 'General', 'advanced-twenty-seventeen' ),29 'panel' => 'ats_global_panel',30 'priority' => $section_priority++,31 ) );32 33 $wp_customize->add_setting( 'ats_general_background_image', array(34 'default' => '',35 'type' => 'theme_mod',36 ) );37 38 $wp_customize->add_control( $this->option_background( array(39 'setting' => 'ats_general_background_image',40 'label' => __( 'Background Image', 'advanced-twenty-seventeen' ),41 'section' => 'ats_general_section',42 'priority' => $control_priority++,43 ), $wp_customize ) );44 45 $wp_customize->add_setting( 'ats_general_background_repeat', array(46 'default' => 'repeat',47 'type' => 'theme_mod',48 ) );49 50 $wp_customize->add_control( 'ats_general_background_repeat', $this->option_background_repeat( array(51 'label' => __( 'Background Repeat', 'advanced-twenty-seventeen' ),52 'section' => 'ats_general_section',53 'priority' => $control_priority++,54 ) ) );55 56 $wp_customize->add_setting( 'ats_general_background_position', array(57 'default' => 'left top',58 'type' => 'theme_mod',59 ) );60 61 $wp_customize->add_control( 'ats_general_background_position', $this->option_background_position( array(62 'label' => __( 'Background Position', 'advanced-twenty-seventeen' ),63 'section' => 'ats_general_section',64 'priority' => $control_priority++,65 ) ) );66 67 $wp_customize->add_setting( 'ats_general_background_attachment', array(68 'default' => 'inherit',69 'type' => 'theme_mod',70 ) );71 72 $wp_customize->add_control( 'ats_general_background_attachment', $this->option_background_attachment( array(73 'label' => __( 'Background Attachment', 'advanced-twenty-seventeen' ),74 'section' => 'ats_general_section',75 'priority' => $control_priority++,76 ) ) );77 78 $wp_customize->add_setting( 'ats_general_background_color', array(79 'default' => '',80 'type' => 'theme_mod',81 ) );82 83 $wp_customize->add_control( $this->option_color( array(84 'setting' => 'ats_general_background_color',85 'label' => __( 'Background Color', 'advanced-twenty-seventeen' ),86 'section' => 'ats_general_section',87 'priority' => $control_priority++,88 ), $wp_customize ) );89 90 $wp_customize->add_setting( 'ats_general_color', array(91 'default' => '',92 'type' => 'theme_mod',93 ) );94 95 $wp_customize->add_control( $this->option_color( array(96 'setting' => 'ats_general_color',97 'label' => __( 'Text Color', 'advanced-twenty-seventeen' ),98 'section' => 'ats_general_section',99 'priority' => $control_priority++,100 ), $wp_customize ) );101 102 $wp_customize->add_setting( 'ats_general_heading_color', array(103 'default' => '',104 'type' => 'theme_mod',105 ) );106 107 $wp_customize->add_control( $this->option_color( array(108 'setting' => 'ats_general_heading_color',109 'label' => __( 'Heading Color', 'advanced-twenty-seventeen' ),110 'section' => 'ats_general_section',111 'priority' => $control_priority++,112 ), $wp_customize ) );113 114 $wp_customize->add_setting( 'ats_general_link_color', array(115 'default' => '',116 'type' => 'theme_mod',117 ) );118 119 $wp_customize->add_control( $this->option_color( array(120 'setting' => 'ats_general_link_color',121 'label' => __( 'Link Color', 'advanced-twenty-seventeen' ),122 'section' => 'ats_general_section',123 'priority' => $control_priority++,124 ), $wp_customize ) );125 126 $wp_customize->add_setting( 'ats_general_link_color_hover', array(127 'default' => '',128 'type' => 'theme_mod',129 ) );130 131 $wp_customize->add_control( $this->option_color( array(132 'setting' => 'ats_general_link_color_hover',133 'label' => __( 'Link Color on Hover', 'advanced-twenty-seventeen' ),134 'section' => 'ats_general_section',135 'priority' => $control_priority++,136 ), $wp_customize ) );137 138 $wp_customize->add_section( 'ats_layout_section', array(139 'title' => __( 'Layout', 'advanced-twenty-seventeen' ),140 'panel' => 'ats_global_panel',141 'priority' => $section_priority++,142 ) );143 144 $wp_customize->add_setting( 'ats_site_layout', array(145 'default' => 'full_width',146 'type' => 'theme_mod',147 ) );148 149 $wp_customize->add_control( 'ats_site_layout', array(150 'label' => __( 'Layout', 'twentyseventeen' ),151 'section' => 'ats_layout_section',152 'type' => 'select',153 'priority' => $control_priority++,154 'choices' => array(155 'full_width' => __( 'Full Width', 'advanced-twenty-seventeen' ),156 'boxed' => __( 'Boxed', 'advanced-twenty-seventeen' ),157 ),158 ) );159 160 // Section Header161 $wp_customize->add_panel( 'ats_header_panel', array(162 'title' => __( 'Advanced: Header', 'advanced-twenty-seventeen' ),163 'priority' => $panel_priority++,164 ) );165 166 $wp_customize->add_section( 'ats_header_general_section', array(167 'title' => __( 'General', 'advanced-twenty-seventeen' ),168 'panel' => 'ats_header_panel',169 'priority' => $section_priority++,170 ) );171 172 $wp_customize->add_setting( 'ats_header_background_image', array(173 'default' => '',174 'type' => 'theme_mod',175 ) );176 177 $wp_customize->add_control( $this->option_background( array(178 'setting' => 'ats_header_background_image',179 'label' => __( 'Background Image', 'advanced-twenty-seventeen' ),180 'section' => 'ats_header_general_section',181 'priority' => $control_priority++,182 ), $wp_customize ) );183 184 $wp_customize->add_setting( 'ats_header_background_repeat', array(185 'default' => 'no-repeat',186 'type' => 'theme_mod',187 ) );188 189 $wp_customize->add_control( 'ats_header_background_repeat', $this->option_background_repeat( array(190 'label' => __( 'Background Repeat', 'advanced-twenty-seventeen' ),191 'section' => 'ats_header_general_section',192 'priority' => $control_priority++,193 ) ) );194 195 $wp_customize->add_setting( 'ats_header_background_position', array(196 'default' => 'left top',197 'type' => 'theme_mod',198 ) );199 200 $wp_customize->add_control( 'ats_header_background_position', $this->option_background_position( array(201 'label' => __( 'Background Position', 'advanced-twenty-seventeen' ),202 'section' => 'ats_header_general_section',203 'priority' => $control_priority++,204 ) ) );205 206 $wp_customize->add_setting( 'ats_header_general_background_color', array(207 'default' => '',208 'type' => 'theme_mod',209 ) );210 211 $wp_customize->add_control( $this->option_color( array(212 'setting' => 'ats_header_general_background_color',213 'label' => __( 'Background Color', 'advanced-twenty-seventeen' ),214 'section' => 'ats_header_general_section',215 'priority' => $control_priority++,216 ), $wp_customize ) );217 218 $wp_customize->add_section( 'ats_branding_section', array(219 'title' => __( 'Site Branding', 'advanced-twenty-seventeen' ),220 'panel' => 'ats_header_panel',221 'priority' => $section_priority++,222 ) );223 224 $wp_customize->add_setting( 'ats_branding_align', array(225 'default' => 'left',226 'type' => 'theme_mod',227 ) );228 229 $wp_customize->add_control( 'ats_branding_align', array(230 'label' => __( 'Align', 'twentyseventeen' ),231 'section' => 'ats_branding_section',232 'type' => 'select',233 'priority' => $control_priority++,234 'choices' => array(235 'left' => __( 'Left', 'advanced-twenty-seventeen' ),236 'center' => __( 'Center', 'advanced-twenty-seventeen' ),237 'right' => __( 'Right', 'advanced-twenty-seventeen' ),238 ),239 'description' => __( 'Horizontal align for site branding', 'advanced-twenty-seventeen' ),240 ) );241 242 $wp_customize->add_setting( 'ats_header_site_title_color', array(243 'default' => '',244 'type' => 'theme_mod',245 ) );246 247 $wp_customize->add_control( $this->option_color( array(248 'setting' => 'ats_header_site_title_color',249 'label' => __( 'Site Title Color', 'advanced-twenty-seventeen' ),250 'section' => 'ats_branding_section',251 'priority' => $control_priority++,252 ), $wp_customize ) );253 254 $wp_customize->add_setting( 'ats_header_site_title_font_size', array(255 'default' => '',256 'type' => 'theme_mod',257 ) );258 259 $wp_customize->add_control( 'ats_header_site_title_font_size', array(260 'label' => __( 'Size Title Font Size', 'advanced-twenty-seventeen' ),261 'section' => 'ats_branding_section',262 'type' => 'text',263 'priority' => $control_priority++,264 'description' => __( 'For example: 36px, 1.2em, 2rem', 'advanced-twenty-seventeen' ),265 'input_attrs' => array(266 'placeholder' => '36px',267 ),268 ) );269 270 $wp_customize->add_setting( 'ats_header_site_description_color', array(271 'default' => '',272 'type' => 'theme_mod',273 ) );274 275 $wp_customize->add_control( $this->option_color( array(276 'setting' => 'ats_header_site_description_color',277 'label' => __( 'Site Description Color', 'advanced-twenty-seventeen' ),278 'section' => 'ats_branding_section',279 'priority' => $control_priority++,280 ), $wp_customize ) );281 282 $wp_customize->add_section( 'ats_menu_section', array(283 'title' => __( 'Menu', 'advanced-twenty-seventeen' ),284 'panel' => 'ats_header_panel',285 'priority' => $section_priority++,286 ) );287 288 $wp_customize->add_setting( 'ats_menu_align', array(289 'default' => 'left',290 'type' => 'theme_mod',291 ) );292 293 $wp_customize->add_control( 'ats_menu_align', array(294 'label' => __( 'Align', 'twentyseventeen' ),295 'section' => 'ats_menu_section',296 'type' => 'select',297 'priority' => $control_priority++,298 'choices' => array(299 'left' => __( 'Left', 'advanced-twenty-seventeen' ),300 'center' => __( 'Center', 'advanced-twenty-seventeen' ),301 'right' => __( 'Right', 'advanced-twenty-seventeen' ),302 ),303 'description' => __( 'Horizontal align for menu', 'advanced-twenty-seventeen' ),304 ) );305 306 $wp_customize->add_setting( 'ats_menu_background_image', array(307 'default' => '',308 'type' => 'theme_mod',309 ) );310 311 $wp_customize->add_control( $this->option_background( array(312 'setting' => 'ats_menu_background_image',313 'label' => __( 'Background Image', 'advanced-twenty-seventeen' ),314 'section' => 'ats_menu_section',315 'priority' => $control_priority++,316 ), $wp_customize ) );317 318 $wp_customize->add_setting( 'ats_menu_background_repeat', array(319 'default' => 'repeat',320 'type' => 'theme_mod',321 ) );322 323 $wp_customize->add_control( 'ats_menu_background_repeat', $this->option_background_repeat( array(324 'label' => __( 'Background Repeat', 'advanced-twenty-seventeen' ),325 'section' => 'ats_menu_section',326 'priority' => $control_priority++,327 ) ) );328 329 $wp_customize->add_setting( 'ats_menu_background_position', array(330 'default' => 'left top',331 'type' => 'theme_mod',332 ) );333 334 $wp_customize->add_control( 'ats_menu_background_position', $this->option_background_position( array(335 'label' => __( 'Background Position', 'advanced-twenty-seventeen' ),336 'section' => 'ats_menu_section',337 'priority' => $control_priority++,338 ) ) );339 340 $wp_customize->add_setting( 'ats_menu_background_color', array(341 'default' => '',342 'type' => 'theme_mod',343 ) );344 345 $wp_customize->add_control( $this->option_color( array(346 'setting' => 'ats_menu_background_color',347 'label' => __( 'Background Color', 'advanced-twenty-seventeen' ),348 'section' => 'ats_menu_section',349 'priority' => $control_priority++,350 ), $wp_customize ) );351 352 $wp_customize->add_setting( 'ats_menu_border_top', array(353 'default' => '1px solid #eee',354 'type' => 'theme_mod',355 ) );356 357 $wp_customize->add_control( 'ats_menu_border_top', array(358 'label' => __( 'Item Font Size', 'advanced-twenty-seventeen' ),359 'section' => 'ats_menu_section',360 'type' => 'text',361 'priority' => $control_priority++,362 'description' => __( 'For example: 1px solid #eee or none', 'advanced-twenty-seventeen' ),363 ) );364 365 $wp_customize->add_setting( 'ats_menu_border_bottom', array(366 'default' => '1px solid #eee',367 'type' => 'theme_mod',368 ) );369 370 $wp_customize->add_control( 'ats_menu_border_bottom', array(371 'label' => __( 'Item Font Size', 'advanced-twenty-seventeen' ),372 'section' => 'ats_menu_section',373 'type' => 'text',374 'priority' => $control_priority++,375 'description' => __( 'For example: 1px solid #eee or none', 'advanced-twenty-seventeen' ),376 ) );377 378 $wp_customize->add_setting( 'ats_menu_color', array(379 'default' => '',380 'type' => 'theme_mod',381 ) );382 383 $wp_customize->add_control( $this->option_color( array(384 'setting' => 'ats_menu_color',385 'label' => __( 'Item Color', 'advanced-twenty-seventeen' ),386 'section' => 'ats_menu_section',387 'priority' => $control_priority++,388 ), $wp_customize ) );389 390 $wp_customize->add_setting( 'ats_menu_color_hover', array(391 'default' => '',392 'type' => 'theme_mod',393 ) );394 395 $wp_customize->add_control( $this->option_color( array(396 'setting' => 'ats_menu_color_hover',397 'label' => __( 'Item Color on Hover', 'advanced-twenty-seventeen' ),398 'section' => 'ats_menu_section',399 'priority' => $control_priority++,400 ), $wp_customize ) );401 402 $wp_customize->add_setting( 'ats_menu_font_size', array(403 'default' => '',404 'type' => 'theme_mod',405 ) );406 407 $wp_customize->add_control( 'ats_menu_font_size', array(408 'label' => __( 'Item Font Size', 'advanced-twenty-seventeen' ),409 'section' => 'ats_menu_section',410 'type' => 'text',411 'priority' => $control_priority++,412 'description' => __( 'For example: 36px, 1.2em, 2rem', 'advanced-twenty-seventeen' ),413 'input_attrs' => array(414 'placeholder' => '14px',415 ),416 ) );417 418 $wp_customize->add_setting( 'ats_menu_text_transform', array(419 'default' => 'inherit',420 'type' => 'theme_mod',421 ) );422 423 $wp_customize->add_control( 'ats_menu_text_transform', $this->option_text_transform( array(424 'label' => __( 'Text Transform', 'advanced-twenty-seventeen' ),425 'section' => 'ats_menu_section',426 'priority' => $control_priority++,427 ) ) );428 429 // Section Footer430 $wp_customize->add_panel( 'ats_footer_panel', array(431 'title' => __( 'Advanced: Footer', 'advanced-twenty-seventeen' ),432 'priority' => $panel_priority++,433 ) );434 435 $wp_customize->add_section( 'ats_footer_copyright_section', array(436 'title' => __( 'Custom Copyright', 'advanced-twenty-seventeen' ),437 'panel' => 'ats_footer_panel',438 'priority' => $section_priority++,439 ) );440 441 $wp_customize->add_setting( 'ats_custom_copyright', array(442 'default' => __( 'Proudly powered by WordPress', 'advanced-twenty-seventeen' ),443 'type' => 'theme_mod',444 'transport' => 'postMessage',445 ) );446 447 $wp_customize->add_control( 'ats_custom_copyright', array(448 'label' => __( 'Custom Copyright', 'twentyseventeen' ),449 'section' => 'ats_footer_copyright_section',450 'type' => 'textarea',451 'priority' => $control_priority++,452 ) );453 454 // Section Custom Code455 $wp_customize->add_panel( 'ats_miscellaneous_panel', array(456 'title' => __( 'Advanced: Miscellaneous', 'advanced-twenty-seventeen' ),457 'priority' => $panel_priority++,458 ) );459 460 $wp_customize->add_section( 'ats_custom_code_section', array(461 'title' => __( 'Custom Code', 'advanced-twenty-seventeen' ),462 'panel' => 'ats_miscellaneous_panel',463 'priority' => $section_priority++,464 ) );465 466 $wp_customize->add_setting( 'ats_custom_code', array(467 'default' => __( '<!-- Your Custom HTML Code -->', 'advanced-twenty-seventeen' ),468 'type' => 'theme_mod',469 ) );470 471 $wp_customize->add_control( 'ats_custom_code', array(472 'label' => __( 'Custom Code', 'twentyseventeen' ),473 'section' => 'ats_custom_code_section',474 'type' => 'textarea',475 'priority' => $control_priority++,476 ) );477 }478 479 public function preview_js() {480 wp_enqueue_script( 'ats-customize-preview', ats()->plugin_url() . '/assets/js/customize-preview.js', array( 'customize-preview' ), ats()->version, true );481 }482 483 public function generate_css() {484 echo '<style id="ats-stylesheet">';485 include( ats()->plugin_path() . '/templates/customizer-stylesheet.php' );486 echo '</style>';487 627 } 488 628 … … 494 634 495 635 public function body_class( $classes ) { 496 $classes[] = 'ats-layout-' . get_theme_mod( 'ats_site_layout', 'full_width' ); 636 $classes[] = 'ats-layout-' . Kirki::get_option( 'ats', 'ats_site_layout' ); 637 638 if ( is_customize_preview ) { 639 $classes[] = 'ats-preview'; 640 } 641 497 642 return $classes; 498 643 } 499 644 500 protected function option_background( array $option, $wp_customize) { 501 return new WP_Customize_Image_Control( $wp_customize, $option['setting'], array( 502 'label' => $option['label'], 503 'section' => $option['section'], 504 'priority' => $option['priority'], 505 ) ); 506 } 507 508 protected function option_color( array $option, $wp_customize ) { 509 return new WP_Customize_Color_Control( $wp_customize, $option['setting'], array( 510 'label' => $option['label'], 511 'mode' => 'full', 512 'section' => $option['section'], 513 'priority' => $option['priority'], 514 ) ); 515 } 516 517 protected function option_background_repeat( $option ) { 518 return array( 519 'label' => $option['label'], 520 'section' => $option['section'], 521 'type' => 'select', 522 'priority' => $option['priority'], 523 'choices' => array( 524 'repeat' => __( 'Repeat', 'advanced-twenty-seventeen' ), 525 'repeat-x' => __( 'Repeat Horizontal', 'advanced-twenty-seventeen' ), 526 'repeat-y' => __( 'Repeat Vertical', 'advanced-twenty-seventeen' ), 527 'no-repeat' => __( 'No Repeat', 'advanced-twenty-seventeen' ), 528 ), 529 ); 530 } 531 532 protected function option_background_position( $option ) { 533 return array( 534 'label' => $option['label'], 535 'section' => $option['section'], 536 'type' => 'select', 537 'priority' => $option['priority'], 538 'choices' => array( 539 'left top' => __( 'Left Top', 'advanced-twenty-seventeen' ), 540 'left center' => __( 'Left Center', 'advanced-twenty-seventeen' ), 541 'left bottom' => __( 'Left Bottom', 'advanced-twenty-seventeen' ), 542 'right top' => __( 'Right Top', 'advanced-twenty-seventeen' ), 543 'right center' => __( 'Right Center', 'advanced-twenty-seventeen' ), 544 'right bottom' => __( 'Right Bottom', 'advanced-twenty-seventeen' ), 545 'center top' => __( 'Center Top', 'advanced-twenty-seventeen' ), 546 'center center' => __( 'Center Center', 'advanced-twenty-seventeen' ), 547 'center bottom' => __( 'Center Bottom', 'advanced-twenty-seventeen' ), 548 ), 549 ); 550 } 551 552 protected function option_background_attachment( $option ) { 553 return array( 554 'label' => $option['label'], 555 'section' => $option['section'], 556 'type' => 'select', 557 'priority' => $option['priority'], 558 'choices' => array( 559 'scroll' => __( 'Scroll', 'advanced-twenty-seventeen' ), 560 'fixed' => __( 'Fixed', 'advanced-twenty-seventeen' ), 561 'inherit' => __( 'Inherit', 'advanced-twenty-seventeen' ), 562 ), 563 ); 564 } 565 566 protected function option_text_transform( $option ) { 567 return array( 568 'label' => $option['label'], 569 'section' => $option['section'], 570 'type' => 'select', 571 'priority' => $option['priority'], 572 'choices' => array( 573 'none' => __( 'None', 'advanced-twenty-seventeen' ), 574 'capitalize' => __( 'Capitalize', 'advanced-twenty-seventeen' ), 575 'uppercase' => __( 'Uppercase', 'advanced-twenty-seventeen' ), 576 'lowercase' => __( 'Lowercase', 'advanced-twenty-seventeen' ), 577 'inherit' => __( 'Inherit', 'advanced-twenty-seventeen' ), 578 ), 579 ); 580 } 645 protected function choice_background_repeat() { 646 return array( 647 'repeat' => __( 'Repeat', 'advanced-twenty-seventeen' ), 648 'repeat-x' => __( 'Repeat Horizontal', 'advanced-twenty-seventeen' ), 649 'repeat-y' => __( 'Repeat Vertical', 'advanced-twenty-seventeen' ), 650 'no-repeat' => __( 'No Repeat', 'advanced-twenty-seventeen' ), 651 ); 652 } 653 654 protected function choice_background_position() { 655 return array( 656 'left top' => __( 'Left Top', 'advanced-twenty-seventeen' ), 657 'left center' => __( 'Left Center', 'advanced-twenty-seventeen' ), 658 'left bottom' => __( 'Left Bottom', 'advanced-twenty-seventeen' ), 659 'right top' => __( 'Right Top', 'advanced-twenty-seventeen' ), 660 'right center' => __( 'Right Center', 'advanced-twenty-seventeen' ), 661 'right bottom' => __( 'Right Bottom', 'advanced-twenty-seventeen' ), 662 'center top' => __( 'Center Top', 'advanced-twenty-seventeen' ), 663 'center center' => __( 'Center Center', 'advanced-twenty-seventeen' ), 664 'center bottom' => __( 'Center Bottom', 'advanced-twenty-seventeen' ), 665 ); 666 } 667 668 protected function choice_background_attachment() { 669 return array( 670 'scroll' => __( 'Scroll', 'advanced-twenty-seventeen' ), 671 'fixed' => __( 'Fixed', 'advanced-twenty-seventeen' ), 672 'inherit' => __( 'Inherit', 'advanced-twenty-seventeen' ), 673 ); 674 } 675 676 protected function choice_text_transform() { 677 return array( 678 'none' => __( 'None', 'advanced-twenty-seventeen' ), 679 'capitalize' => __( 'Capitalize', 'advanced-twenty-seventeen' ), 680 'uppercase' => __( 'Uppercase', 'advanced-twenty-seventeen' ), 681 'lowercase' => __( 'Lowercase', 'advanced-twenty-seventeen' ), 682 'inherit' => __( 'Inherit', 'advanced-twenty-seventeen' ), 683 ); 684 } 581 685 } 582 686 -
advanced-twenty-seventeen/trunk/readme.txt
r1558751 r1559127 5 5 Requires at least: 4.7 6 6 Tested up to: 4.7 7 Stable tag: 1. 07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 33 33 == Changelog == 34 34 35 = 1.1 = 36 * Improved theme options. 37 35 38 = 1.0 = 36 39 * Initial version.
Note: See TracChangeset
for help on using the changeset viewer.