예제 #1
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     self::$stylesheet = get_stylesheet();
     /**
      * Load Customizer Colors functionality.
      *
      * @since 1.0.0
      */
     require_once get_template_directory() . '/inc/customizer/colors.php';
     /**
      * Load Customizer Fonts functionality.
      *
      * @since 1.0.0
      */
     require_once get_template_directory() . '/inc/customizer/fonts.php';
     /**
      * Load Customizer Layouts functionality.
      *
      * @since 1.0.0
      */
     require_once get_template_directory() . '/inc/customizer/layouts.php';
     add_action('after_setup_theme', array($this, 'logo'));
     add_action('customize_register', array($this, 'selective_refresh'), 11);
     add_action('customize_register', array($this, 'use_featured_hero_image'));
     add_action('customize_preview_init', array($this, 'customize_preview_js'));
 }
예제 #2
0
파일: fonts.php 프로젝트: faithmade/rock
 /**
  * Add inline CSS for the font customizations.
  *
  * @action wp_enqueue_scripts
  * @since  1.0.0
  */
 public function enqueue_inline_css()
 {
     foreach ($this->font_types as $name => $args) {
         if (empty($name) || empty($args['css'])) {
             continue;
         }
         $css = sprintf(Rock_Customizer::parse_css_rules($args['css']), $this->get_font($name));
         wp_add_inline_style(Rock_Customizer::$stylesheet . '-fonts', $css);
     }
 }
예제 #3
0
파일: colors.php 프로젝트: faithmade/rock
 /**
  * Custom header CSS.
  *
  * @see   $this->header()
  * @since 1.0.0
  */
 public function header_css()
 {
     $color = get_header_textcolor();
     $css = $this->get_color_css('header_textcolor');
     if ('blank' === $color) {
         $css = array('.site-title, .site-description' => array('position' => 'absolute', 'clip' => 'rect(1px, 1px, 1px, 1px)'));
     }
     if ($color && $css) {
         printf("<style type='text/css'>\n%s\n</style>", sprintf(Rock_Customizer::parse_css_rules($css), $color));
     }
 }