get_stylesheet_directory_uri() . '/img/header.jpg', 'header-text' => true, 'default-text-color' => 'ffffff', 'width' => absint( sgwindow_get_theme_mod( 'size_image' ) ), 'height' => absint( sgwindow_get_theme_mod( 'size_image_height' ) ), 'flex-height' => true, 'flex-width' => true, ); add_theme_support( 'custom-header', $args ); remove_action( 'sgwindow_empty_sidebar_top-default', 'sgwindow_the_top_sidebar_default', 20 ); remove_action( 'sgwindow_empty_sidebar_top-portfolio-page', 'sgwindow_the_top_sidebar_default', 20 ); remove_action( 'sgwindow_empty_sidebar_before_footer-home', 'sgwindow_the_footer_sidebar_widgets', 20 ); remove_action( 'sgwindow_empty_sidebar_top-home', 'sgwindow_the_top_sidebar_widgets', 20 ); remove_action( 'sgwindow_empty_column_2-portfolio-page', 'sgwindow_right_sidebar_portfolio', 20 ); remove_action( 'admin_menu', 'sgwindow_admin_page' ); remove_action( 'widgets_init', 'sgwindow_register_items_portfolio_widgets' ); if ( '' == sgwindow_get_theme_mod( 'are_we_saved', '' ) ) { add_action('sgwindow_empty_sidebar_top-home', 'layoutbuilder_the_top_sidebar_widgets', 20); } } add_action( 'after_setup_theme', 'layoutbuilder_setup' ); /** * Layot BuilderColors. * * @since Layout Builder 1.0 */ function layoutbuilder_setup_colors() { /* colors */ global $sgwindow_colors_class; $section_id = 'main_colors'; $section_priority = 10; $p = 10; $i = 'link_color'; $sgwindow_colors_class->add_color($i, $section_id, __('Link', 'layout-builder'), $p++, false); $sgwindow_colors_class->set_color($i, 0, '#1e73be'); $sgwindow_colors_class->set_color($i, 1, '#1e73be'); $sgwindow_colors_class->set_color($i, 2, '#1e73be'); $i = 'heading_color'; $sgwindow_colors_class->add_color($i, $section_id, __('H1-H6 heading', 'layout-builder'), $p++, false); $sgwindow_colors_class->set_color($i, 0, '#000000'); $sgwindow_colors_class->set_color($i, 1, '#000000'); $sgwindow_colors_class->set_color($i, 2, '#000000'); $i = 'heading_link'; $sgwindow_colors_class->add_color($i, $section_id, __('H1-H6 Link', 'layout-builder'), $p++, false); $sgwindow_colors_class->set_color($i, 0, '#000000'); $sgwindow_colors_class->set_color($i, 1, '#000000'); $sgwindow_colors_class->set_color($i, 2, '#1e73be'); $i = 'description_color'; $sgwindow_colors_class->add_color($i, $section_id, __('Description', 'layout-builder'), $p++, false); $sgwindow_colors_class->set_color($i, 0, '#ededed'); $sgwindow_colors_class->set_color($i, 1, '#ededed'); $sgwindow_colors_class->set_color($i, 2, '#ededed'); $i = 'hover_color'; $sgwindow_colors_class->add_color($i, $section_id, __('Link Hover', 'layout-builder'), $p++, false, 'refresh'); $sgwindow_colors_class->set_color($i, 0, '#000000'); $sgwindow_colors_class->set_color($i, 1, '#000000'); $sgwindow_colors_class->set_color($i, 2, '#000000'); } add_action( 'after_setup_theme', 'layoutbuilder_setup_colors', 100 ); /** * Enqueue parent and child scripts * * @package WordPress * @subpackage Layout Builder * @since Layout Builder 1.0 */ function layoutbuilder_styles() { wp_enqueue_style( 'sgwindow-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'layoutbuilder-style', get_stylesheet_uri(), array( 'sgwindow-style' ) ); wp_enqueue_style( 'layoutbuilder-colors', get_stylesheet_directory_uri() . '/css/scheme-' . esc_attr( sgwindow_get_theme_mod( 'color_scheme' ) ) . '.css', array( 'sgwindow-style', 'sgwindow-colors' ) ); // Adds JavaScript for handing the navigation menu if ( '1' == sgwindow_get_theme_mod( 'is_sticky_second_menu' ) ) { wp_enqueue_script( 'sgwindow-sticky', get_stylesheet_directory_uri() . '/js/sticky.js', array( 'jquery' ), '201531', true ); } } add_action( 'wp_enqueue_scripts', 'layoutbuilder_styles' ); /** * Set defaults * * @package WordPress * @subpackage Layout Builder * @since Layout Builder 1.0 */ function layoutbuilder_defaults( $defaults ) { /* slider defaults */ $defaults['slider_height'] = '60'; $defaults['slider_margin'] = '15'; $defaults['slider_play'] = '1'; $defaults['slider_content_type'] = '0'; $defaults['slider_speed'] = '500'; $defaults['slider_delay'] = '4000'; $defaults['is_thumbnail_empty_icon'] = ''; $defaults['is_cat'] = '1'; $defaults['is_author'] = '1'; $defaults['is_date'] = '1'; $defaults['is_views'] = ''; $defaults['is_comments'] = '1'; $defaults['blog_is_cat'] = '1'; $defaults['blog_is_author'] = '1'; $defaults['blog_is_date'] = '1'; $defaults['blog_is_views'] = ''; $defaults['blog_is_comments'] = '1'; $defaults['blog_is_entry_meta'] = '1'; $defaults['is_sticky_second_menu'] = '1'; $defaults['site_style'] = 'full'; $defaults['are_we_saved'] = ''; $defaults['max_id'] = 0; $defaults['is_parallax_header'] = '1'; $defaults['content_style'] = 'boxed'; $defaults['is_show_top_menu'] = ''; $defaults['is_show_footer_menu'] = ''; $defaults['body_font'] = 'Alegreya'; $defaults['heading_font'] = 'Josefin Slab'; $defaults['header_font'] = 'Allerta Stencil'; $defaults['body_font_size'] = '16'; $defaults['heading_font_size'] = '36'; $defaults['column_background_url'] = ''; $defaults['logotype_url'] = get_stylesheet_directory_uri() . '/img/logo.png'; $defaults['post_thumbnail_size'] = '400'; $defaults['width_site'] = '1920'; $defaults['width_top_widget_area'] = '1100'; $defaults['width_content_no_sidebar'] = '1100'; $defaults['width_content'] = '1100'; $defaults['width_main_wrapper'] = '1100'; $defaults['is_home_footer'] = '1'; $defaults['front_page_style'] = 'no_content'; /* portfolio: excerpt/content */ $defaults['portfolio_style'] = 'no_content'; /* Header Image size */ $defaults['size_image'] = '1920'; $defaults['size_image_height'] = '600'; /* Header Image and top sidebar wrapper */ $defaults['width_image'] = '1920'; $defaults['width_column_1_left_rate'] = '33'; $defaults['width_column_1_right_rate'] = '33'; $defaults['width_column_1_rate'] = '22'; $defaults['width_column_2_rate'] = '22'; $defaults['scroll_button'] = 'right'; $defaults['single_style'] = 'content'; $defaults['defined_sidebars']['home'] = array( 'use' => '1', 'callback' => 'is_front_page', 'param' => '', 'title' => __( 'Home', 'layout-builder' ), 'sidebar-top' => '1', 'sidebar-before-footer' => '1', 'column-1' => '1', 'column-2' => '1', ); $defaults['footer_text'] = '' . __( 'Powered by WordPress', 'layout-builder' ). ' | ' . __( 'theme ', 'layout-builder' ) . 'Layout Builder'; return $defaults; } add_filter( 'sgwindow_option_defaults', 'layoutbuilder_defaults' ); /** Set theme layout * * @since Layout Builder 1.0 */ function layoutbuilder_layout( $layout ) { foreach( $layout as $id => $layouts ) { if ( 'layout_home' == $layouts['name'] ) { $layout[ $id ]['val'] = 'left-sidebar'; } if ( 'layout_home' == $layouts['name'] || 'layout_blog' == $layouts['name'] || 'layout_archive' == $layouts['name'] ) { $layout[ $id ]['content_val'] = 'default'; } } return $layout; } add_filter( 'sgwindow_layout', 'layoutbuilder_layout' ); /** * Hook widgets into right sidebar at the front page * * @package WordPress * @subpackage Layout Builder * @since Layout Builder 1.0 */ function layoutbuilder_home_right_column( $layouts ) { the_widget( 'WP_Widget_Search', 'title=' ); the_widget( 'WP_Widget_Categories' ); the_widget( 'WP_Widget_Tag_Cloud', 'title=' ); the_widget( 'WP_Widget_Recent_Comments' ); } add_action('sgwindow_empty_column_2-home', 'layoutbuilder_home_right_column', 20); /** * Add widgets to the top sidebar on the home page * * @since Layout Builder 1.0.0 */ function layoutbuilder_the_top_sidebar_widgets() { the_widget( 'sgwindow_side_bar', 'title='.__('Layout 1', 'layout-builder'). '&count=4'. '&width_0=25'. '&width_1=25'. '&width_2=25'. '&width_3=25'. '&sidebar_id_0=0'. '&sidebar_id_1=1'. '&sidebar_id_2=2'. '&sidebar_id_3=3' ); the_widget( 'sgwindow_side_bar', 'title='.__('Layout 2', 'layout-builder'). '&count=2'. '&width_0=30'. '&width_1=70'. '&sidebar_id_0=0'. '&sidebar_id_1=1' ); } /** * Register Sidebar * * @since SG Layout 1.0.0 */ function layoutbuilder_register_sidebars() { for( $i = 0; $i < 6; $i++) { register_sidebar( array( 'name' => __( 'Top', 'layout-builder' ) . ' ' . ( $i + 1), 'id' => 's_' . $i, 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); } } add_action( 'widgets_init', 'layoutbuilder_register_sidebars', 20 ); /** * Header * * @package WordPress * @subpackage Layout Builder * @since Layout Builder 1.0 */ function layoutbuilder_header( $layouts ) { ?>
add_section( 'check', array( 'title' => __( '--', 'layout-builder' ), 'priority' => 200, 'panel' => 'other', ) ); if ( '' == sgwindow_get_theme_mod( 'are_we_saved', '' ) ) { $wp_customize->add_setting( 'are_we_saved', array( 'type' => 'theme_mod', 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox' ) ); $wp_customize->add_control( 'are_we_saved', array ( 'label' => __( '--', 'layout-builder' ), 'section' => 'check', 'settings' => 'are_we_saved', 'type' => 'checkbox', 'priority' => 1, ) ); } $wp_customize->add_setting( 'max_id', array( 'type' => 'theme_mod', 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'max_id', array ( 'label' => __( 'Max id', 'layout-builder' ), 'section' => 'check', 'settings' => 'max_id', 'type' => 'input', ) ); /* remove controls */ $wp_customize->remove_control( 'is_show_top_menu' ); $wp_customize->remove_control( 'is_show_footer_menu' ); } /** * Add custom js for the Customizer screen. * * @since Layout Builder 1.0.0 */ function layoutbuilder_customize_controls_enqueue_scripts() { wp_enqueue_script( 'layoutbuilder-customize-control-js', get_stylesheet_directory_uri() . '/inc/js/customize.js', array( 'jquery' ), false, true ); } add_action('customize_controls_enqueue_scripts', 'layoutbuilder_customize_controls_enqueue_scripts'); /** * Enqueue Javascript postMessage handlers for the Customizer. * * Binds JS handlers to make the Customizer preview reload changes asynchronously. * * @since Layout Builder 1.0.0 */ function layoutbuilder_customize_preview_js() { wp_enqueue_script( 'layoutbuilder-customizer', get_stylesheet_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), time() . '11.12.2020', true ); } add_action( 'customize_preview_init', 'layoutbuilder_customize_preview_js', 99 ); //admin page require get_stylesheet_directory() . '/inc/admin-page.php'; //widget-sidebar if( ! class_exists( 'sgwindow_side_bar' ) ) { require get_stylesheet_directory() . '/inc/widget-sidebar.php'; } //portfolio if( class_exists( 'Jetpack' ) && ! class_exists( 'sgwindow_portfolio' ) ) { require get_stylesheet_directory() . '/inc/widget-featured-portfolio.php'; }