"", $prefix . "background_body_image_position_x" => "center", $prefix . "background_body_image_position_y" => "center", $prefix . "background_body_image_size" => "auto auto", $prefix . "background_body_image_repeat" => 1, $prefix . "background_body_image_scroll" => 1, $prefix . "background_color_top" => "#4f4f4f", $prefix . "background_color_bottom" => "#000000", $prefix . "background_color_top_transparent" => 0, $prefix . "background_color_bottom_transparent" => 0, $prefix . "background_opacity" => "1", $prefix . "background_image" => "", $prefix . "background_image_position_x" => "center", $prefix . "background_image_position_y" => "center", $prefix . "background_image_size" => "auto auto", $prefix . "background_image_repeat" => 1, $prefix . "background_image_scroll" => 1, $prefix . "background_head_color_top" => "#0a0a0a", $prefix . "background_head_color_bottom" => "#7a7a7a", $prefix . "background_head_color_top_transparent" => 0, $prefix . "background_head_color_bottom_transparent" => 0, $prefix . "background_head_opacity" => "1", $prefix . "background_head_image" => "", $prefix . "background_head_image_position_x" => "center", $prefix . "background_head_image_position_y" => "center", $prefix . "background_head_image_size" => "auto auto", $prefix . "background_head_image_repeat" => 1, $prefix . "background_head_image_scroll" => 1, $prefix . "background_nav_top_color_top" => "#000000", $prefix . "background_nav_top_color_bottom" => "#4c4c4c", $prefix . "background_nav_top_color_top_transparent" => 0, $prefix . "background_nav_top_color_bottom_transparent" => 0, $prefix . "background_nav_top_opacity" => "0.4", $prefix . "background_nav_top_image" => "", $prefix . "background_nav_top_image_position_x" => "center", $prefix . "background_nav_top_image_position_y" => "center", $prefix . "background_nav_top_image_size" => "auto auto", $prefix . "background_nav_top_image_repeat" => 1, $prefix . "background_nav_top_image_scroll" => 1, $prefix . "link_font_nav_top_color" => "#ffffff", $prefix . "link_hover_font_nav_top_color" => "#00a3f4", $prefix . "link_font_nav_top_color_transparent" => 0, $prefix . "link_hover_font_nav_top_color_transparent" => 0, $prefix . "border_nav_top_color" => "#565656", $prefix . "border_nav_top_color_transparent" => 0, $prefix . "link_font_content_head_color" => "#ffffff", $prefix . "link_font_content_head_color_transparent" => 0, $prefix . "link_hover_font_content_head_color" => "#00a3f4", $prefix . "link_hover_font_content_head_color_transparent" => 0, $prefix . "font_content_head_description_color" => "#dd3333", $prefix . "font_content_head_description_color_transparent" => 0, $prefix . "border_content_head_description_color" => "#dd3333", $prefix . "border_content_head_description_color_transparent" => 0, $prefix . "background_nav_head_color_top" => "#757575", $prefix . "background_nav_head_color_bottom" => "#000000", $prefix . "background_nav_head_color_top_transparent" => 0, $prefix . "background_nav_head_color_bottom_transparent" => 0, $prefix . "background_nav_head_opacity" => "0.8", $prefix . "background_nav_head_image" => "", $prefix . "background_nav_head_image_position_x" => "center", $prefix . "background_nav_head_image_position_y" => "center", $prefix . "background_nav_head_image_size" => "auto auto", $prefix . "background_nav_head_image_repeat" => 1, $prefix . "background_nav_head_image_scroll" => 1, $prefix . "link_font_nav_head_color" => "#ffffff", $prefix . "link_hover_font_nav_head_color" => "#00a3f4", $prefix . "link_font_nav_head_color_transparent" => 0, $prefix . "link_hover_font_nav_head_color_transparent" => 0, $prefix . "border_nav_head_color" => "#8e8e8e", $prefix . "border_nav_head_color_transparent" => 0, $prefix . "background_nav_head_dropdown_color_top" => "#757575", $prefix . "background_nav_head_dropdown_color_bottom" => "#000000", $prefix . "background_nav_head_dropdown_color_top_transparent" => 0, $prefix . "background_nav_head_dropdown_color_bottom_transparent" => 0, $prefix . "background_nav_head_dropdown_opacity" => "0.8", $prefix . "background_nav_head_dropdown_image" => "", $prefix . "background_nav_head_dropdown_image_position_x" => "center", $prefix . "background_nav_head_dropdown_image_position_y" => "center", $prefix . "background_nav_head_dropdown_image_size" => "auto auto", $prefix . "background_nav_head_dropdown_image_repeat" => 1, $prefix . "background_nav_head_dropdown_image_scroll" => 1, $prefix . "link_font_nav_head_dropdown_color" => "#ffffff", $prefix . "link_hover_font_nav_head_dropdown_color" => "#00a3f4", $prefix . "link_font_nav_head_dropdown_color_transparent" => 0, $prefix . "link_hover_font_nav_head_dropdown_color_transparent" => 0, $prefix . "border_nav_head_dropdown_color" => "#8e8e8e", $prefix . "border_nav_head_dropdown_color_transparent" => 0, $prefix . "background_nav_content_color_top" => "#757575", $prefix . "background_nav_content_color_bottom" => "#000000", $prefix . "background_nav_content_color_top_transparent" => 0, $prefix . "background_nav_content_color_bottom_transparent" => 0, $prefix . "background_nav_content_opacity" => "1", $prefix . "background_nav_content_image" => "", $prefix . "background_nav_content_image_position_x" => "center", $prefix . "background_nav_content_image_position_y" => "center", $prefix . "background_nav_content_image_size" => "auto auto", $prefix . "background_nav_content_image_repeat" => 1, $prefix . "background_nav_content_image_scroll" => 1, $prefix . "link_font_nav_content_color" => "#ffffff", $prefix . "link_hover_font_nav_content_color" => "#00a3f4", $prefix . "link_font_nav_content_color_transparent" => 0, $prefix . "link_hover_font_nav_content_color_transparent" => 0, $prefix . "border_nav_content_color" => "#8e8e8e", $prefix . "border_nav_content_color_transparent" => 0, $prefix . "background_nav_content_dropdown_opacity" => "1", $prefix . "background_content_color_top" => "#757575", $prefix . "background_content_color_bottom" => "#000000", $prefix . "background_content_color_top_transparent" => 1, $prefix . "background_content_color_bottom_transparent" => 1, $prefix . "background_content_opacity" => "0", $prefix . "background_content_image" => "", $prefix . "background_content_image_position_x" => "center", $prefix . "background_content_image_position_y" => "center", $prefix . "background_content_image_size" => "auto auto", $prefix . "background_content_image_repeat" => 1, $prefix . "background_content_image_scroll" => 1, $prefix . "font_content_color" => "#fefefe", $prefix . "font_content_color_transparent" => 0, $prefix . "link_font_content_color" => "#00a3f4", $prefix . "link_hover_font_content_color" => "#fefefe", $prefix . "link_font_content_color_transparent" => 0, $prefix . "link_hover_font_content_color_transparent" => 0, $prefix . "border_content_color" => "#adadad", $prefix . "border_content_color_transparent" => 0, $prefix . "background_widget_color_top" => "#a3a3a3", $prefix . "background_widget_color_bottom" => "#0a0a0a", $prefix . "background_widget_color_top_transparent" => 1, $prefix . "background_widget_color_bottom_transparent" => 1, $prefix . "background_widget_opacity" => "0", $prefix . "background_widget_image" => "", $prefix . "background_widget_image_position_x" => "center", $prefix . "background_widget_image_position_y" => "center", $prefix . "background_widget_image_size" => "auto auto", $prefix . "background_widget_image_repeat" => 1, $prefix . "background_widget_image_scroll" => 1, $prefix . "font_widget_color" => "#fefefe", $prefix . "font_widget_color_transparent" => 0, $prefix . "link_font_widget_color" => "#fefefe", $prefix . "link_hover_font_widget_color" => "#00a3f4", $prefix . "link_font_widget_color_transparent" => 0, $prefix . "link_hover_font_widget_color_transparent" => 0, $prefix . "border_widget_color" => "#adadad", $prefix . "border_widget_color_transparent" => 0, $prefix . "background_nav_footer_color_top" => "#a3a3a3", $prefix . "background_nav_footer_color_bottom" => "#0a0a0a", $prefix . "background_nav_footer_color_top_transparent" => 0, $prefix . "background_nav_footer_color_bottom_transparent" => 0, $prefix . "background_nav_footer_opacity" => "0.4", $prefix . "background_nav_footer_image" => "", $prefix . "background_nav_footer_image_position_x" => "center", $prefix . "background_nav_footer_image_position_y" => "center", $prefix . "background_nav_footer_image_size" => "auto auto", $prefix . "background_nav_footer_image_repeat" => 1, $prefix . "background_nav_footer_image_scroll" => 1, $prefix . "link_font_nav_footer_color" => "#ffffff", $prefix . "link_hover_font_nav_footer_color" => "#00a3f4", $prefix . "link_font_nav_footer_color_transparent" => 0, $prefix . "link_hover_font_nav_footer_color_transparent" => 0, $prefix . "border_nav_footer_color" => "#000000", $prefix . "border_nav_footer_color_transparent" => 0, $prefix . "background_foot_text_color_top" => "#666666", $prefix . "background_foot_text_color_bottom" => "#000000", $prefix . "background_foot_text_color_top_transparent" => 0, $prefix . "background_foot_text_color_bottom_transparent" => 0, $prefix . "background_foot_text_opacity" => "0.4", $prefix . "background_foot_text_image" => "", $prefix . "background_foot_text_image_position_x" => "center", $prefix . "background_foot_text_image_position_y" => "center", $prefix . "background_foot_text_image_size" => "auto auto", $prefix . "background_foot_text_image_repeat" => 1, $prefix . "background_foot_text_image_scroll" => 1, $prefix . "font_foot_text_color" => "#fefefe", $prefix . "font_foot_text_color_transparent" => 0, $prefix . "border_foot_text_color" => "#000000", $prefix . "border_foot_text_color_transparent" => 0, $prefix . "foot_text_year" => "1975", $prefix . "head_height" => "200px", $prefix . "content_height" => "200px", $prefix . "footer_height" => "200px", $prefix . "top_padding_h" => ".5rem", $prefix . "top_padding_v" => "1rem", $prefix . "main_nav_padding_h" => ".5rem", $prefix . "main_nav_padding_v" => "1rem", $prefix . "footer_nav_padding_h" => ".5rem", $prefix . "footer_nav_padding_v" => "1rem", $prefix . "footer_text_padding_v" => "1rem", $prefix . "top_font_size" => "1rem", $prefix . "head_content_header_font_size" => "2.5rem", $prefix . "head_content_font_size" => "1rem", $prefix . "main_nav_font_size" => "1rem", $prefix . "content_nav_font_size" => "1rem", $prefix . "content_font_size" => "1rem", $prefix . "content_h1_font_size" => "2.5rem", $prefix . "content_h2_font_size" => "2rem", $prefix . "content_h3_font_size" => "1.5rem", $prefix . "foot_nav_font_size" => "1rem", $prefix . "widget_font_size" => "1rem", $prefix . "widget_header_font_size" => "2.5rem", $prefix . "footer_text_font_size" => "1rem", $prefix . "show_search" => 1, $prefix . "add_space" => 1, $prefix . "round_corners" => 0, $prefix . "border_radius" => "16px", $prefix . "center_content" => 1, $prefix . "show_post_nav" => 1, $prefix . "show_page_nav" => 1, ]; /* For debugging, reset default values for customizer: \remove_theme_mods(); */ foreach ( static::$customizer_elements as $mod => $value ) { $mod_check = get_theme_mod( $mod ); if ( $mod_check === false ) { \set_theme_mod( $mod, $value ); } } // Sprachdateien werden eingebunden: self::load_textdomain(); // Erhalte die Einstellungen zum Plugin: self::get_options(); // Aktualisierung des Plugins (ggf): self::update_plugin(); // Customizer add_action( 'customize_preview_init', [ $this, 'customizer_preview_enqueue' ] ); add_action( 'customize_controls_enqueue_scripts', [ $this, 'customizer_controls_enqueue' ] ); add_action( 'customize_register', [ $this, 'customizer_register' ] ); add_action( 'wp_head', [ $this, 'customizer_css' ] ); // Enable Builtin Options add_theme_support( "post-thumbnails" ); add_theme_support( "custom-header" ); add_theme_support( 'title-tag' ); add_theme_support( 'html5', [ 'comment-form', 'comment-list', 'gallery', 'caption', ] ); add_theme_support( 'post-formats', [ 'image', 'video', 'gallery', 'audio', ] ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'automatic-feed-links' ); // Menüs des Themes add_action( "after_setup_theme", [ $this, "register_menus" ] ); // Sidebars aktivieren add_action( 'widgets_init', [ $this, 'register_sidebars' ] ); // Scripte einbinden add_action( "admin_enqueue_scripts", [ $this, "load_admin_scripts" ] ); add_action( "wp_enqueue_scripts", [ $this, "load_frontend_scripts" ] ); // Nav Link CSS Manipulation add_filter( 'next_posts_link_attributes', [ $this, 'nav_link_attributes' ] ); add_filter( 'previous_posts_link_attributes', [ $this, "nav_link_attributes" ] ); // Excerpt Manipulation add_filter( 'excerpt_length', [ $this, 'new_excerpt_length' ] ); add_filter( 'excerpt_more', [ $this, 'new_excerpt_more' ] ); // additional image sizes add_image_size( 'fazzo-featured-image', 9999, 330 ); add_image_size( 'fazzo-nav-image', 9999, 20 ); // Custom Widgets add_action( 'widgets_init', [ $this, 'register_widgets' ] ); // Zeige diese Optionsseite nur an, wenn der User die Rechte dazu hat: if ( current_user_can( 'manage_options' ) ) { // Zeige Optionsseite an add_action( 'admin_menu', [ $this, 'settings_page' ] ); } // Metaboxen add_action( "add_meta_boxes", [ $this, "register_meta_boxes" ] ); // Funktionen beim Speichern add_action( 'save_post', [ $this, 'save_post' ] ); // Editor Style Location add_action( 'admin_init', [ $this, 'add_editor_style' ] ); } /** * Aktionen bei Plugin Aktivierung * * @param $network_wide boolean Teilt mit, ob Netzwerkweit aktiviert werden soll * * @return void * @since 1.0.0 * @access public * @static * */ public static function activation( $network_wide ) { // Sprachdateien werden eingebunden. self::load_textdomain(); // Überprüft die minimal erforderliche PHP- u. WP-Version. self::check_system_requirements(); // Aktualisierung des Plugins (ggf). self::update_plugin(); } /** * Aktionen bei Plugin Deaktivierung * * @param $network_wide boolean Teilt mit, ob Netzwerkweit aktiviert werden soll * * @return void * @since 1.0.0 * @access public * @static * */ public static function deactivation( $network_wide ) { self::delete_options(); } /** * Einbindung der Sprachdateien * @return void * @since 1.0.0 * @access protected * @static */ protected static function load_textdomain() { load_plugin_textdomain( "fazzotheme", false, sprintf( '%s/lang/', dirname( plugin_basename( __FILE__ ) ) ) ); } /** * Überprüft die minimal erforderliche PHP- u. WP-Version * @return void * @since 1.0.0 * @access protected * @static */ protected static function check_system_requirements() { $error = ''; if ( version_compare( PHP_VERSION, self::php_version, '<' ) ) { $error = sprintf( __( 'FAZZO-Theme: Your server is running PHP version %s. Please upgrade at least to PHP version %s.', "fazzotheme" ), PHP_VERSION, self::wp_version ); } if ( version_compare( $GLOBALS['wp_version'], self::wp_version, '<' ) ) { $error = sprintf( __( 'FAZZO-Theme: Your Wordpress version is %s. Please upgrade at least to Wordpress version %s.', "fazzotheme" ), $GLOBALS['wp_version'], self::wp_version ); } if ( ! empty( $error ) ) { deactivate_plugins( plugin_basename( __FILE__ ), false, true ); wp_die( $error ); } } /** * Aktualisiere Plugin, wenn nötig * @return void * @since 1.0.0 * @access protected * @static */ private static function update_plugin() { $version_stored = get_option( static::version_option_name, '0' ); if ( version_compare( $version_stored, static::version, '<' ) ) { // Führe Update durch: update_option( static::version_option_name, static::version ); } } /** * Löscht alle Einstellungen * @return void * @since 1.0.0 * @access protected * @static */ protected static function delete_options() { delete_option( static::option_name ); delete_option( self::version_option_name ); // Todo: Settings der einzelnen Pages/Posts löschen } /** * Setzt die Einstellungen und Eigenschaften, mit Berücksichtung auf Default Einstellungen * @return void * @since 1.0.0 * @access protected * @static */ protected static function get_options() { $defaults = static::default_options(); $options = get_option( static::option_name ); if ( $options === false ) { $options = []; } functions::parse_args_multidim( $options, $defaults ); static::$options = $options; static::set_class_properties(); } /** * Standardeinstellungen definieren * @return array * @since 1.0.0 * @access protected * @static */ private static function default_options() { // Multidimensionales Array ist möglich: $options = [ "load_bootstrap" => 1 ]; $options = [ "paged_menu" => 0 ]; return $options; } /** * Setzt die Eigenschaften der Klasse * @return void * @since 1.0.0 * @access protected * @static */ protected static function set_class_properties() { } /** * Die Menü Positionen des Themes bekannt geben * @return void * @since 1.0.0 * @access public */ public function register_menus() { register_nav_menu( "meta-bottom-nav", "Bottom menu" ); register_nav_menu( "meta-content-nav", "Content menu" ); register_nav_menu( "meta-frontpage-nav", "Frontpage menu" ); register_nav_menu( "meta-head-nav", "Main menu" ); register_nav_menu( "meta-top-nav", "Top menu" ); } /** * Sidebars für die Startseite aktivieren * @return void * @since 1.0.0 * @access public */ public function register_sidebars() { // Bottom register_sidebar( [ 'name' => __( 'Bottom A', "fazzotheme" ), 'id' => 'fazzo-sidebar-bottom-a', 'description' => __( 'Bottom sidebar', "fazzotheme" ), 'before_widget' => '
', 'before_title' => ''; } else { $content .= '
'; } } echo $content; } /** * Wenn der Post gespeichert wird * * @param int $post_id Die ID des Posts * * @return void * @since 1.0.0 * @access public * */ public function save_post( $post_id ) { if ( array_key_exists( 'fazzo_options', $_POST ) ) { update_post_meta( $post_id, static::option_name, $_POST['fazzo_options'] ); } } /** * Customizer Preview enqueue Scripts and Styles * @return void * @since 1.0.0 * @access public */ public function customizer_preview_enqueue() { wp_enqueue_script( 'fazzo-theme-customizer-pre-js', get_template_directory_uri() . '/js/customizer_preview.js', [ 'jquery', 'customize-preview', ], static::version, true ); wp_enqueue_style( "fazzo-theme-customizer-css", get_template_directory_uri() . "/css/customizer.css", [], static::version, 'all' ); } /** * Customizer Control enqueue Scripts and Styles * @return void * @since 1.0.0 * @access public */ public function customizer_controls_enqueue() { wp_enqueue_script( 'fazzo-theme-customizer-con-js', get_template_directory_uri() . '/js/customizer_controls.js', [ 'jquery', 'customize-preview', ], static::version, true ); } /** * Customizer * @return void * @since 1.0.0 * @access public */ public function customizer_register( $wp_customize ) { $customizer_set = []; $customizer = new customizer( $wp_customize ); $panel_style = $customizer->add_panel( "style", __( 'Change style', "fazzotheme" ), __( 'Set specific styles', "fazzotheme" ) ); $section_background_style = $customizer->add_section( "background_style", $panel_style, __( 'Site', "fazzotheme" ), __( 'Set specific site backgrounds', "fazzotheme" ) ); $section_head_style = $customizer->add_section( "background_head_style", $panel_style, __( 'Head', "fazzotheme" ), __( 'Set specific head backgrounds', "fazzotheme" ) ); $section_nav_top_style = $customizer->add_section( "nav_top_style", $panel_style, __( 'Head top', "fazzotheme" ), __( 'Set specific top styles', "fazzotheme" ) ); $section_head_content_style = $customizer->add_section( "head_content_style", $panel_style, __( 'Head content', "fazzotheme" ), __( 'Set specific head content styles', "fazzotheme" ) ); $section_nav_head_style = $customizer->add_section( "nav_head_style", $panel_style, __( 'Head navigation', "fazzotheme" ), __( 'Set specific head navigation styles', "fazzotheme" ) ); $section_nav_head_dropdown_style = $customizer->add_section( "nav_head_dropdown_style", $panel_style, __( 'Head navigation dropdown', "fazzotheme" ), __( 'Set specific top styles', "fazzotheme" ) ); $section_content_style = $customizer->add_section( "content_style", $panel_style, __( 'Content', "fazzotheme" ), __( 'Set specific content styles', "fazzotheme" ) ); $section_nav_content_style = $customizer->add_section( "nav_content_style", $panel_style, __( 'Content navigation', "fazzotheme" ), __( 'Set specific navigation content styles', "fazzotheme" ) ); $section_nav_footer_style = $customizer->add_section( "nav_footer_style", $panel_style, __( 'Footer navigation', "fazzotheme" ), __( 'Set specific navigation footer styles', "fazzotheme" ) ); $section_text_footer_style = $customizer->add_section( "text_footer_style", $panel_style, __( 'Footer', "fazzotheme" ), __( 'Set specific footer styles', "fazzotheme" ) ); $section_widget_style = $customizer->add_section( "widget_style", $panel_style, __( 'Widgets', "fazzotheme" ), __( 'Set specific widget styles', "fazzotheme" ) ); $section_sizes_spaces = $customizer->add_section( "sizes_spaces", $panel_style, __( 'Sizes and Spaces', "fazzotheme" ), __( 'Set specific sizes and spaces', "fazzotheme" ) ); $section_settings = $customizer->add_section( "settings", $panel_style, __( 'Settings', "fazzotheme" ), __( 'Set specific settings', "fazzotheme" ) ); // Background Site $customizer_collect = []; $customizer_collect["element"] = "body"; $customizer_collect["image"] = $customizer->add_control( "image", "background_body_image", $section_background_style, __( 'Image layer 1', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#body_overlay"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_color_top", $section_background_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_color_bottom", $section_background_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_opacity", $section_background_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_image", $section_background_style, __( 'Image layer 2', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Background Head $customizer_collect = []; $customizer_collect["element"] = "#sec_head"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_head_color_top", $section_head_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_head_color_bottom", $section_head_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_head_opacity", $section_head_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_head_image", $section_head_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Head top $customizer_collect = []; $customizer_collect["element"] = "#sec_head_meta"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_nav_top_color_top", $section_nav_top_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_nav_top_color_bottom", $section_nav_top_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_nav_top_opacity", $section_nav_top_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_nav_top_color", $section_nav_top_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_nav_top_color", $section_nav_top_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_nav_top_color", $section_nav_top_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_nav_top_image", $section_nav_top_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Head Content $customizer_collect = []; $customizer_collect["element"] = "#head-title"; $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_content_head_color", $section_head_content_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_content_head_color", $section_head_content_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#head-description span"; $customizer_collect["font_color"] = $customizer->add_control( "color", "font_content_head_description_color", $section_head_content_style, __( 'Font color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_content_head_description_color", $section_head_content_style, __( 'Border color', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Head Nav $customizer_collect = []; $customizer_collect["element"] = "#sec_head_nav"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_nav_head_color_top", $section_nav_head_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_nav_head_color_bottom", $section_nav_head_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_nav_head_opacity", $section_nav_head_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_nav_head_color", $section_nav_head_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_nav_head_color", $section_nav_head_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_nav_head_color", $section_nav_head_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_nav_head_image", $section_nav_head_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Head Nav Dropdown $customizer_collect = []; $customizer_collect["element"] = "#sec_head_nav .dropdown-menu"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_nav_head_dropdown_color_top", $section_nav_head_dropdown_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_nav_head_dropdown_color_bottom", $section_nav_head_dropdown_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_nav_head_dropdown_opacity", $section_nav_head_dropdown_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_nav_head_dropdown_color", $section_nav_head_dropdown_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_nav_head_dropdown_color", $section_nav_head_dropdown_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_nav_head_dropdown_color", $section_nav_head_dropdown_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_nav_head_dropdown_image", $section_nav_head_dropdown_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Content Nav $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_nav"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_nav_content_color_top", $section_nav_content_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_nav_content_color_bottom", $section_nav_content_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_nav_content_opacity", $section_nav_content_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_nav_content_color", $section_nav_content_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_nav_content_color", $section_nav_content_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_nav_content_color", $section_nav_content_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_nav_content_image", $section_nav_content_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; // Content $customizer_collect = []; $customizer_collect["element"] = "article"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_content_color_top", $section_content_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_content_color_bottom", $section_content_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_content_opacity", $section_content_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["font_color"] = $customizer->add_control( "color", "font_content_color", $section_content_style, __( 'Font color', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_content_color", $section_content_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_content_color", $section_content_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_content_color", $section_content_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_content_image", $section_content_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Widgets $customizer_collect = []; $customizer_collect["element"] = ".widget"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_widget_color_top", $section_widget_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_widget_color_bottom", $section_widget_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_widget_opacity", $section_widget_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["font_color"] = $customizer->add_control( "color", "font_widget_color", $section_widget_style, __( 'Font color', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_widget_color", $section_widget_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_widget_color", $section_widget_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_widget_color", $section_widget_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_widget_image", $section_widget_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Footer Nav $customizer_collect = []; $customizer_collect["element"] = "#sec_foot_nav"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_nav_footer_color_top", $section_nav_footer_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_nav_footer_color_bottom", $section_nav_footer_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_nav_footer_opacity", $section_nav_footer_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["link_font_color"] = $customizer->add_control( "color", "link_font_nav_footer_color", $section_nav_footer_style, __( 'Link color', "fazzotheme" ) ); $customizer_collect["link_hover_font_color"] = $customizer->add_control( "color", "link_hover_font_nav_footer_color", $section_nav_footer_style, __( 'Link hover color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_nav_footer_color", $section_nav_footer_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_nav_footer_image", $section_nav_footer_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Footer Text $customizer_collect = []; $customizer_collect["element"] = "#sec_foot_text"; $customizer_collect["color_top"] = $customizer->add_control( "color", "background_foot_text_color_top", $section_text_footer_style, __( 'Color top', "fazzotheme" ) ); $customizer_collect["color_bottom"] = $customizer->add_control( "color", "background_foot_text_color_bottom", $section_text_footer_style, __( 'Color bottom', "fazzotheme" ) ); $customizer_collect["opacity"] = $customizer->add_control( "text", "background_foot_text_opacity", $section_text_footer_style, __( 'Opacity', "fazzotheme" ) ); $customizer_collect["font_color"] = $customizer->add_control( "color", "font_foot_text_color", $section_text_footer_style, __( 'Font color', "fazzotheme" ) ); $customizer_collect["border_color"] = $customizer->add_control( "color", "border_foot_text_color", $section_text_footer_style, __( 'Border color', "fazzotheme" ) ); $customizer_collect["text_year"] = $customizer->add_control( "text", "foot_text_year", $section_text_footer_style, __( 'Start year', "fazzotheme" ) ); $customizer_collect["image"] = $customizer->add_control( "image", "background_foot_text_image", $section_text_footer_style, __( 'Image', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; // Sizes / Spaces $customizer_collect = []; $customizer_collect["element"] = "#sec_head_content"; $customizer_collect["height"] = $customizer->add_control( "text", "head_height", $section_sizes_spaces, __( 'Head min. height', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_output"; $customizer_collect["height"] = $customizer->add_control( "text", "content_height", $section_sizes_spaces, __( 'Content min. height', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_foot_widget"; $customizer_collect["height"] = $customizer->add_control( "text", "footer_height", $section_sizes_spaces, __( 'Footer widget min. height', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#menu-meta-top li a"; $customizer_collect["padding_h"] = $customizer->add_control( "text", "top_padding_h", $section_sizes_spaces, __( 'Top navigation padding horiz', "fazzotheme" ) ); $customizer_collect["padding_v"] = $customizer->add_control( "text", "top_padding_v", $section_sizes_spaces, __( 'Top navigation padding vert.', "fazzotheme" ) ); $customizer_collect = []; $customizer_set[] = $customizer_collect; $customizer_collect["element"] = "#meta-head-nav ul li a"; $customizer_collect["padding_h"] = $customizer->add_control( "text", "main_nav_padding_h", $section_sizes_spaces, __( 'Main navigation padding horiz.', "fazzotheme" ) ); $customizer_collect["padding_v"] = $customizer->add_control( "text", "main_nav_padding_v", $section_sizes_spaces, __( 'Main navigation padding vert.', "fazzotheme" ) ); $customizer_collect = []; $customizer_set[] = $customizer_collect; $customizer_collect["element"] = "#meta-bottom-nav ul li a"; $customizer_collect["padding_h"] = $customizer->add_control( "text", "footer_nav_padding_h", $section_sizes_spaces, __( 'Footer navigation padding horiz.', "fazzotheme" ) ); $customizer_collect["padding_v"] = $customizer->add_control( "text", "footer_nav_padding_v", $section_sizes_spaces, __( 'Footer navigation padding vert.', "fazzotheme" ) ); $customizer_collect = []; $customizer_set[] = $customizer_collect; $customizer_collect["element"] = "#wrap_foot_text"; $customizer_collect["padding_v"] = $customizer->add_control( "text", "footer_text_padding_v", $section_sizes_spaces, __( 'Footer text padding vert.', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; // Todo: Padding Widgets $customizer_collect["element"] = "#sec_head_meta"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "top_font_size", $section_sizes_spaces, __( 'Top font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#head-title"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "head_content_header_font_size", $section_sizes_spaces, __( 'Head header font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#head-description"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "head_content_font_size", $section_sizes_spaces, __( 'Head text font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#sec_head_nav"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "main_nav_font_size", $section_sizes_spaces, __( 'Main navigation font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_nav"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "content_nav_font_size", $section_sizes_spaces, __( 'Content navigation font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_output"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "content_font_size", $section_sizes_spaces, __( 'Content font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_output h1"; $customizer_collect["font_size"] = $customizer->add_control( "text", "content_h1_font_size", $section_sizes_spaces, __( 'Content header 1 font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_output h2"; $customizer_collect["font_size"] = $customizer->add_control( "text", "content_h2_font_size", $section_sizes_spaces, __( 'Content header 2 font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_content_output h3"; $customizer_collect["font_size"] = $customizer->add_control( "text", "content_h3_font_size", $section_sizes_spaces, __( 'Content header 3 font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_foot_nav"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "foot_nav_font_size", $section_sizes_spaces, __( 'Footer navigation font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = ".widget"; $customizer_collect["font_size_text"] = $customizer->add_control( "text", "widget_font_size", $section_sizes_spaces, __( 'Widget font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = ".widget h1"; $customizer_collect["font_size"] = $customizer->add_control( "text", "widget_header_font_size", $section_sizes_spaces, __( 'Widget header font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; $customizer_collect["element"] = "#wrap_foot_text"; $customizer_collect["font_size"] = $customizer->add_control( "text", "footer_text_font_size", $section_sizes_spaces, __( 'Footer text font size', "fazzotheme" ) ); $customizer_set[] = $customizer_collect; $customizer_collect = []; // Settings $customizer_settings = []; $customizer_settings["show_search"] = $customizer->add_control( "checkbox", "show_search", $section_settings, __( 'Search', "fazzotheme" ) ); $customizer_settings["add_space"] = $customizer->add_control( "checkbox", "add_space", $section_settings, __( 'Increase inner distance', "fazzotheme" ) ); $customizer_settings["round_corners"] = $customizer->add_control( "checkbox", "round_corners", $section_settings, __( 'Round borders', "fazzotheme" ) ); $customizer_settings["border_radius"] = $customizer->add_control( "text", "border_radius", $section_settings, __( 'Radius', "fazzotheme" ) ); $customizer_settings["center_content"] = $customizer->add_control( "checkbox", "center_content", $section_settings, __( 'Content centered', "fazzotheme" ) ); $customizer_settings["show_post_nav"] = $customizer->add_control( "checkbox", "show_post_nav", $section_settings, __( 'Show post navigation links', "fazzotheme" ) ); $customizer_settings["show_page_nav"] = $customizer->add_control( "checkbox", "show_page_nav", $section_settings, __( 'Show page navigation links', "fazzotheme" ) ); $js_content = <<