示例#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));
     }
 }