'ffffff',
));
add_image_size( 'architect-civil-engineer-featured-image', 2000, 1200, true );
add_image_size( 'architect-civil-engineer-thumbnail-avatar', 100, 100, true );
$GLOBALS['content_width'] = 525;
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'architect-civil-engineer' ),
) );
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', 'architect_civil_engineer_setup' );
// widgets
function architect_civil_engineer_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'architect-civil-engineer' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'architect-civil-engineer' ),
'id' => 'sidebar-2',
'description' => __( 'Add widgets here to appear in your pages and posts', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'architect-civil-engineer' ),
'id' => 'sidebar-3',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'architect-civil-engineer' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'architect-civil-engineer' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'architect-civil-engineer' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 4', 'architect-civil-engineer' ),
'id' => 'footer-4',
'description' => __( 'Add widgets here to appear in your footer.', 'architect-civil-engineer' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'architect_civil_engineer_widgets_init' );
//sanitize dropdown
function architect_civil_engineer_sanitize_dropdown_pages( $architect_civil_engineer_page_id, $setting ) {
$architect_civil_engineer_page_id = absint( $architect_civil_engineer_page_id );
return ( 'publish' == get_post_status( $architect_civil_engineer_page_id ) ? $architect_civil_engineer_page_id : $setting->default );
}
// remove sections
function architect_civil_engineer_customize_register() {
global $wp_customize;
$wp_customize->remove_section( 'construction_firm_pro' );
$wp_customize->remove_section( 'construction_firm_middle_section' );
$wp_customize->remove_setting( 'construction_firm_call_text' );
$wp_customize->remove_control( 'construction_firm_call_text' );
$wp_customize->remove_setting( 'construction_firm_call' );
$wp_customize->remove_control( 'construction_firm_call' );
$wp_customize->remove_setting( 'construction_firm_email_text' );
$wp_customize->remove_control( 'construction_firm_email_text' );
$wp_customize->remove_setting( 'construction_firm_email' );
$wp_customize->remove_control( 'construction_firm_email' );
$wp_customize->remove_setting( 'construction_firm_timing_text' );
$wp_customize->remove_control( 'construction_firm_timing_text' );
$wp_customize->remove_setting( 'construction_firm_timing' );
$wp_customize->remove_control( 'construction_firm_timing' );
$wp_customize->remove_setting( 'construction_firm_contact_show_hide' );
$wp_customize->remove_control( 'construction_firm_contact_show_hide' );
$wp_customize->remove_setting( 'construction_firm_timimg_icon' );
$wp_customize->remove_control( 'construction_firm_timimg_icon' );
$wp_customize->remove_setting( 'construction_firm_call_icon' );
$wp_customize->remove_control( 'construction_firm_call_icon' );
$wp_customize->remove_setting( 'construction_firm_email_icon' );
$wp_customize->remove_control( 'construction_firm_email_icon' );
$wp_customize->remove_setting( 'construction_firm_footer_text' );
$wp_customize->remove_control( 'construction_firm_footer_text' );
$wp_customize->remove_setting( 'construction_firm_slider_opacity' );
$wp_customize->remove_control( 'construction_firm_slider_opacity' );
//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' );
$wp_customize->remove_setting( 'construction_firm_home_sec_bg' );
$wp_customize->remove_control( 'construction_firm_home_sec_bg' );
}
add_action( 'customize_register', 'architect_civil_engineer_customize_register', 11 );
// customizer
function architect_civil_engineer_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('architect_civil_engineer_pro', array(
'title' => __('UPGRADE ARCHITECT PREMIUM', 'architect-civil-engineer'),
'priority' => 1,
));
$wp_customize->add_setting('architect_civil_engineer_pro', array(
'default' => null,
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(new Architect_Civil_Engineer_Pro_Control($wp_customize, 'architect_civil_engineer_pro', array(
'label' => __('ARCHITECT CIVIL PREMIUM', 'architect-civil-engineer'),
'section' => 'architect_civil_engineer_pro',
'settings' => 'architect_civil_engineer_pro',
'priority' => 1,
)));
$wp_customize->add_setting('architect_civil_engineer_slider_opacity',array(
'default' => '1',
'sanitize_callback' => 'construction_firm_sanitize_choices'
));
$wp_customize->add_control('architect_civil_engineer_slider_opacity',array(
'type' => 'radio',
'label' => __('Slider Opacity', 'architect-civil-engineer'),
'section' => 'construction_firm_slider_section',
'type' => 'select',
'choices' => array(
'0' => __('0','architect-civil-engineer'),
'0.1' => __('0.1','architect-civil-engineer'),
'0.2' => __('0.2','architect-civil-engineer'),
'0.3' => __('0.3','architect-civil-engineer'),
'0.4' => __('0.4','architect-civil-engineer'),
'0.5' => __('0.5','architect-civil-engineer'),
'0.6' => __('0.6','architect-civil-engineer'),
'0.7' => __('0.7','architect-civil-engineer'),
'0.8' => __('0.8','architect-civil-engineer'),
'0.9' => __('0.9','architect-civil-engineer'),
'1' => __('1','architect-civil-engineer')
),
) );
//Services Section
$wp_customize->add_section( 'architect_civil_engineer_middle_section' , array(
'title' => __( 'Services Settings', 'architect-civil-engineer' ),
'priority' => 4,
'panel' => 'construction_firm_custompage_panel',
) );
$wp_customize->add_setting( 'architect_civil_engineer_middle_heading', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new Architect_Civil_Engineer_Customizer_Customcontrol_Section_Heading( $wp_customize, 'architect_civil_engineer_middle_heading', array(
'label' => esc_html__( 'Services Settings', 'architect-civil-engineer' ),
'section' => 'architect_civil_engineer_middle_section',
'settings' => 'architect_civil_engineer_middle_heading',
) ) );
$wp_customize->add_setting(
'architect_civil_engineer_services_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 Architect_Civil_Engineer_Customizer_Customcontrol_Switch(
$wp_customize,
'architect_civil_engineer_services_show_hide',
array(
'settings' => 'architect_civil_engineer_services_show_hide',
'section' => 'architect_civil_engineer_middle_section',
'label' => __( 'Check To Show services', 'architect-civil-engineer' ),
'choices' => array(
'1' => __( 'On', 'architect-civil-engineer' ),
'off' => __( 'Off', 'architect-civil-engineer' ),
),
'active_callback' => '',
)
)
);
$architect_civil_engineer_args = array('numberposts' => -1);
$post_list = get_posts($architect_civil_engineer_args);
$s = 0;
$pst_sls[]= __('Select','architect-civil-engineer');
foreach ($post_list as $key => $p_post) {
$pst_sls[$p_post->ID]=$p_post->post_title;
}
for ( $s = 1; $s <= 3; $s++ ) {
$wp_customize->add_setting('architect_civil_engineer_middle_sec_settigs'.$s,array(
'sanitize_callback' => 'construction_firm_sanitize_choices',
));
$wp_customize->add_control('architect_civil_engineer_middle_sec_settigs'.$s,array(
'type' => 'select',
'choices' => $pst_sls,
'label' => __('Select post','architect-civil-engineer'),
'section' => 'architect_civil_engineer_middle_section',
));
}
wp_reset_postdata();
// About Us Section
$wp_customize->add_section( 'architect_civil_engineer_about_us_section' , array(
'title' => __( 'About Us Settings', 'architect-civil-engineer' ),
'priority' => 4,
'panel' => 'construction_firm_custompage_panel',
) );
$wp_customize->add_setting( 'architect_civil_engineer_about_heading', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new Architect_Civil_Engineer_Customizer_Customcontrol_Section_Heading( $wp_customize, 'architect_civil_engineer_about_heading', array(
'label' => esc_html__( 'About Us Settings', 'architect-civil-engineer' ),
'section' => 'architect_civil_engineer_about_us_section',
'settings' => 'architect_civil_engineer_about_heading',
) ) );
$wp_customize->add_setting(
'architect_civil_engineer_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 Architect_Civil_Engineer_Customizer_Customcontrol_Switch(
$wp_customize,
'architect_civil_engineer_about_show_hide',
array(
'settings' => 'architect_civil_engineer_about_show_hide',
'section' => 'architect_civil_engineer_about_us_section',
'label' => __( 'Check To Show services', 'architect-civil-engineer' ),
'choices' => array(
'1' => __( 'On', 'architect-civil-engineer' ),
'off' => __( 'Off', 'architect-civil-engineer' ),
),
'active_callback' => '',
)
)
);
$wp_customize->add_setting('architect_civil_engineer_about_us_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('architect_civil_engineer_about_us_title',array(
'label' => esc_html__('Section Title','architect-civil-engineer'),
'section' => 'architect_civil_engineer_about_us_section',
'setting' => 'architect_civil_engineer_about_us_title',
'type' => 'text',
));
$wp_customize->selective_refresh->add_partial( 'architect_civil_engineer_about_us_title', array(
'selector' => '#about-us h4',
'render_callback' => 'construction_firm_customize_partial_architect_civil_engineer_about_us_title',
) );
$wp_customize->add_setting('architect_civil_engineer_about_us_settigs',array(
'sanitize_callback' => 'construction_firm_sanitize_dropdown_pages',
));
$wp_customize->add_control('architect_civil_engineer_about_us_settigs',array(
'type' => 'dropdown-pages',
'label' => __('Select Page','architect-civil-engineer'),
'section' => 'architect_civil_engineer_about_us_section',
));
$wp_customize->add_setting('architect_civil_engineer_footer_text',array(
'default' => 'Architect WordPress Theme',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('architect_civil_engineer_footer_text',array(
'label' => esc_html__('Copyright Text','architect-civil-engineer'),
'section' => 'construction_firm_footer_copyright',
'type' => 'textarea'
));
$wp_customize->selective_refresh->add_partial( 'architect_civil_engineer_footer_text', array(
'selector' => '.site-info a',
'render_callback' => 'construction_firm_customize_partial_architect_civil_engineer_footer_text',
) );
//colors
$wp_customize->add_setting('architect_civil_engineer_primary_color', array(
'default' => '#ffee02',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_primary_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Color', 'architect-civil-engineer'),
)));
$wp_customize->add_setting('architect_civil_engineer_heading_color', array(
'default' => '#1d1d1d',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_heading_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Heading Color', 'architect-civil-engineer'),
)));
$wp_customize->add_setting('architect_civil_engineer_text_color', array(
'default' => '#787878',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_text_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Text Color', 'architect-civil-engineer'),
)));
$wp_customize->add_setting('architect_civil_engineer_primary_fade', array(
'default' => '#fffde7',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_primary_fade', array(
'section' => 'colors',
'label' => esc_html__('theme Color fade', 'architect-civil-engineer'),
)));
$wp_customize->add_setting('architect_civil_engineer_service_box_bg', array(
'default' => '#212529',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_service_box_bg', array(
'section' => 'colors',
'label' => esc_html__('Service Box Bg color', 'architect-civil-engineer'),
)));
$wp_customize->add_setting('architect_civil_engineer_footer_bg', array(
'default' => '#1d1d1d',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_civil_engineer_footer_bg', array(
'section' => 'colors',
'label' => esc_html__('Footer Bg color', 'architect-civil-engineer'),
)));
}
add_action( 'customize_register', 'architect_civil_engineer_customize' );
// comments
function architect_civil_engineer_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', 'architect_civil_engineer_enqueue_comments_reply' );
// Footer Text
function architect_civil_engineer_copyright_link() {
$architect_civil_engineer_footer_text = get_theme_mod('architect_civil_engineer_footer_text', esc_html__('Architect WordPress Theme', 'architect-civil-engineer'));
$architect_civil_engineer_credit_link = esc_url('https://www.ovationthemes.com/products/free-architect-wordpress-theme');
echo '' . esc_html($architect_civil_engineer_footer_text) . '';
}
/* Pro control */
if (class_exists('WP_Customize_Control') && !class_exists('Architect_Civil_Engineer_Pro_Control')):
class Architect_Civil_Engineer_Pro_Control extends WP_Customize_Control{
public function render_content(){?>