'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() ) );
if ( ! defined( 'CONSTRUCTION_FIRM_SUPPORT' ) ) {
define('CONSTRUCTION_FIRM_SUPPORT',__('https://wordpress.org/support/theme/construction-firm/','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_REVIEW' ) ) {
define('CONSTRUCTION_FIRM_REVIEW',__('https://wordpress.org/support/theme/construction-firm/reviews/','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_LIVE_DEMO' ) ) {
define('CONSTRUCTION_FIRM_LIVE_DEMO',__('https://trial.ovationthemes.com/construction-firm/','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_BUY_PRO' ) ) {
define('CONSTRUCTION_FIRM_BUY_PRO',__('https://www.ovationthemes.com/products/construction-wordpress-theme','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_PRO_DOC' ) ) {
define('CONSTRUCTION_FIRM_PRO_DOC',__('https://trial.ovationthemes.com/docs/ot-construction-firm-pro-doc/','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_FREE_DOC' ) ) {
define('CONSTRUCTION_FIRM_FREE_DOC',__('https://trial.ovationthemes.com/docs/ot-construction-firm-free-doc/','construction-firm'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_THEME_NAME' ) ) {
define('CONSTRUCTION_FIRM_THEME_NAME',__('Premium Construction Theme','construction-firm'));
}
}
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' => '',
'before_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' => '',
'before_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' => '',
'before_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' => '',
'before_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' => '',
'before_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' => '',
'before_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' => '',
'before_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' );
$wp_customize->remove_setting( 'construction_firm_footer_text' );
$wp_customize->remove_control( 'construction_firm_footer_text' );
//colors
$wp_customize->remove_setting( 'construction_firm_primary_color' );
$wp_customize->remove_control( 'construction_firm_primary_color' );
$wp_customize->remove_setting( 'construction_firm_heading_color' );
$wp_customize->remove_control( 'construction_firm_heading_color' );
$wp_customize->remove_setting( 'construction_firm_text_color' );
$wp_customize->remove_control( 'construction_firm_text_color' );
$wp_customize->remove_setting( 'construction_firm_primary_fade' );
$wp_customize->remove_control( 'construction_firm_primary_fade' );
$wp_customize->remove_setting( 'construction_firm_footer_bg' );
$wp_customize->remove_control( 'construction_firm_footer_bg' );
}
add_action( 'customize_register', 'building_construction_lite_customize_register', 11 );
// 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' => '1',
'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',
));
$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' => 'construction_firm_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',
));
$wp_customize->add_setting('building_construction_lite_footer_text',array(
'default' => 'Building WordPress Theme',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('building_construction_lite_footer_text',array(
'label' => esc_html__('Copyright Text','building-construction-lite'),
'section' => 'construction_firm_footer_copyright',
'type' => 'textarea'
));
$wp_customize->selective_refresh->add_partial( 'building_construction_lite_footer_text', array(
'selector' => '.site-info a',
'render_callback' => 'construction_firm_customize_partial_building_construction_lite_footer_text',
) );
//colors
$wp_customize->add_setting('building_construction_lite_primary_color', array(
'default' => '#f7a238',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'building_construction_lite_primary_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Color', 'building-construction-lite'),
)));
$wp_customize->add_setting('building_construction_lite_heading_color', array(
'default' => '#1d1d1d',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'building_construction_lite_heading_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Heading Color', 'building-construction-lite'),
)));
$wp_customize->add_setting('building_construction_lite_text_color', array(
'default' => '#787878',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'building_construction_lite_text_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Text Color', 'building-construction-lite'),
)));
$wp_customize->add_setting('building_construction_lite_primary_fade', array(
'default' => '#fff2e2',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'building_construction_lite_primary_fade', array(
'section' => 'colors',
'label' => esc_html__('theme Color fade', 'building-construction-lite'),
)));
$wp_customize->add_setting('building_construction_lite_footer_bg', array(
'default' => '#1d1d1d',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'building_construction_lite_footer_bg', array(
'section' => 'colors',
'label' => esc_html__('Footer Bg color', 'building-construction-lite'),
)));
}
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' );
// Footer Text
function building_construction_lite_copyright_link() {
$building_construction_lite_footer_text = get_theme_mod('building_construction_lite_footer_text', esc_html__('Building WordPress Theme', 'building-construction-lite'));
$building_construction_lite_credit_link = esc_url('https://www.ovationthemes.com/products/free-building-wordpress-theme');
echo '' . esc_html($building_construction_lite_footer_text) . '';
}
/* 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(){?>