'ffffff', )); add_image_size( 'building-construction-lite-featured-image', 2000, 1200, true ); add_image_size( 'building-construction-lite-thumbnail-avatar', 100, 100, true ); $GLOBALS['content_width'] = 525; register_nav_menus( array( 'primary' => __( 'Primary Menu', 'building-construction-lite' ), ) ); add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. */ add_editor_style( array( 'assets/css/editor-style.css', construction_firm_fonts_url() ) ); } add_action( 'after_setup_theme', 'building_construction_lite_setup' ); // widgets function building_construction_lite_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'building-construction-lite' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Sidebar', 'building-construction-lite' ), 'id' => 'sidebar-2', 'description' => __( 'Add widgets here to appear in your pages and posts', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar 3', 'building-construction-lite' ), 'id' => 'sidebar-3', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 1', 'building-construction-lite' ), 'id' => 'footer-1', 'description' => __( 'Add widgets here to appear in your footer.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 2', 'building-construction-lite' ), 'id' => 'footer-2', 'description' => __( 'Add widgets here to appear in your footer.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 3', 'building-construction-lite' ), 'id' => 'footer-3', 'description' => __( 'Add widgets here to appear in your footer.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 4', 'building-construction-lite' ), 'id' => 'footer-4', 'description' => __( 'Add widgets here to appear in your footer.', 'building-construction-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'building_construction_lite_widgets_init' ); // remove sections function building_construction_lite_customize_register() { global $wp_customize; $wp_customize->remove_section( 'construction_firm_pro' ); } add_action( 'customize_register', 'building_construction_lite_customize_register', 11 ); // sanitization dropdown function building_construction_lite_sanitize_dropdown_pages( $building_construction_lite_page_id, $setting ) { $building_construction_lite_page_id = absint( $building_construction_lite_page_id ); return ( 'publish' == get_post_status( $building_construction_lite_page_id ) ? $building_construction_lite_page_id : $setting->default ); } // about customizer dropdown function building_construction_lite_about_us_dropdown(){ if(get_option('building_construction_lite_about_us_section') == true ) { return true; } return false; } // customizer function building_construction_lite_customize( $wp_customize ) { wp_enqueue_style('customizercustom_css', esc_url( get_stylesheet_directory_uri() ). '/assets/css/customizer.css'); require get_theme_file_path( 'inc/custom-control.php' ); // pro section $wp_customize->add_section('building_construction_lite_pro', array( 'title' => __('UPGRADE BUILDING PREMIUM', 'building-construction-lite'), 'priority' => 1, )); $wp_customize->add_setting('building_construction_lite_pro', array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Building_Construction_Lite_Pro_Control($wp_customize, 'building_construction_lite_pro', array( 'label' => __('BUILDING CONSTRUCTION PREMIUM', 'building-construction-lite'), 'section' => 'building_construction_lite_pro', 'settings' => 'building_construction_lite_pro', 'priority' => 1, ))); // About Us Section $wp_customize->add_section( 'building_construction_lite_about_us_section' , array( 'title' => __( 'About Us Settings', 'building-construction-lite' ), 'priority' => 5, 'panel' => 'construction_firm_custompage_panel', ) ); $wp_customize->add_setting( 'building_construction_lite_about_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Building_Construction_Lite_Customizer_Customcontrol_Section_Heading( $wp_customize, 'building_construction_lite_about_heading', array( 'label' => esc_html__( 'About Us Settings', 'building-construction-lite' ), 'section' => 'building_construction_lite_about_us_section', 'settings' => 'building_construction_lite_about_heading', ) ) ); $wp_customize->add_setting( 'building_construction_lite_about_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'construction_firm_callback_sanitize_switch', ) ); $wp_customize->add_control( new Building_Construction_Lite_Customizer_Customcontrol_Switch( $wp_customize, 'building_construction_lite_about_show_hide', array( 'settings' => 'building_construction_lite_about_show_hide', 'section' => 'building_construction_lite_about_us_section', 'label' => __( 'Check To Show services', 'building-construction-lite' ), 'choices' => array( '1' => __( 'On', 'building-construction-lite' ), 'off' => __( 'Off', 'building-construction-lite' ), ), 'active_callback' => '', ) ) ); $wp_customize->add_setting('building_construction_lite_about_us_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('building_construction_lite_about_us_title',array( 'label' => esc_html__('Section Title','building-construction-lite'), 'section' => 'building_construction_lite_about_us_section', 'setting' => 'building_construction_lite_about_us_title', 'type' => 'text', 'active_callback' => 'building_construction_lite_about_us_dropdown', )); $wp_customize->selective_refresh->add_partial( 'building_construction_lite_about_us_title', array( 'selector' => '#about-us h4', 'render_callback' => 'construction_firm_customize_partial_building_construction_lite_about_us_title', ) ); $wp_customize->add_setting('building_construction_lite_about_us_settigs',array( 'sanitize_callback' => 'building_construction_lite_sanitize_dropdown_pages', )); $wp_customize->add_control('building_construction_lite_about_us_settigs',array( 'type' => 'dropdown-pages', 'label' => __('Select Page','building-construction-lite'), 'section' => 'building_construction_lite_about_us_section', 'active_callback' => 'building_construction_lite_about_us_dropdown', )); } add_action( 'customize_register', 'building_construction_lite_customize' ); // comments function building_construction_lite_enqueue_comments_reply() { if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) { // Load comment-reply.js (into footer) wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true ); } } add_action( 'wp_enqueue_scripts', 'building_construction_lite_enqueue_comments_reply' ); define('BUILDING_CONSTRUCTION_LITE_PRO_LINK',__('https://www.ovationthemes.com/wordpress/building-construction-wordpress-theme/','building-construction-lite')); if ( ! defined( 'CONSTRUCTION_FIRM_SUPPORT' ) ) { define('CONSTRUCTION_FIRM_SUPPORT',__('https://wordpress.org/support/theme/building-construction-lite','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_REVIEW' ) ) { define('CONSTRUCTION_FIRM_REVIEW',__('https://wordpress.org/support/theme/building-construction-lite/reviews/#new-post','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_LIVE_DEMO' ) ) { define('CONSTRUCTION_FIRM_LIVE_DEMO',__('https://www.ovationthemes.com/demos/building-construction/','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_BUY_PRO' ) ) { define('CONSTRUCTION_FIRM_BUY_PRO',__('https://www.ovationthemes.com/wordpress/building-construction-wordpress-theme/','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_PRO_DOC' ) ) { define('CONSTRUCTION_FIRM_PRO_DOC',__('https://ovationthemes.com/docs/ot-building-construction-pro-doc/','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_FREE_DOC' ) ) { define('CONSTRUCTION_FIRM_FREE_DOC',__('https://ovationthemes.com/docs/ot-building-construction-lite-free-doc','building-construction-lite')); } if ( ! defined( 'CONSTRUCTION_FIRM_THEME_NAME' ) ) { define('CONSTRUCTION_FIRM_THEME_NAME',__('Premium Building Construction Theme','building-construction-lite')); } /* Pro control */ if (class_exists('WP_Customize_Control') && !class_exists('Building_Construction_Lite_Pro_Control')): class Building_Construction_Lite_Pro_Control extends WP_Customize_Control{ public function render_content(){?>