'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() ) );
}
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 );
}
//customizer dropdown
function architect_civil_engineer_about_dropdown(){
if(get_option('architect_civil_engineer_about_show_hide') == true ) {
return true;
}
return false;
}
function architect_civil_engineer_services_dropdown(){
if(get_option('architect_civil_engineer_services_show_hide') == true ) {
return true;
}
return false;
}
// 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' );
}
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,
)));
// slider
$wp_customize->add_setting('architect_civil_engineer_slide_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('architect_civil_engineer_slide_title',array(
'label' => esc_html__('Section Small Title','architect-civil-engineer'),
'section' => 'construction_firm_slider_section',
'setting' => 'architect_civil_engineer_slide_title',
'type' => 'text',
'active_callback' => 'construction_firm_slider_dropdown'
));
//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' => '',
'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',
'active_callback' => 'architect_civil_engineer_services_dropdown',
));
}
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' => '',
'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',
'active_callback' => 'architect_civil_engineer_about_dropdown',
));
$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' => 'architect_civil_engineer_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',
'active_callback' => 'architect_civil_engineer_about_dropdown',
));
}
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' );
if ( ! defined( 'ARCHITECT_CIVIL_ENGINEER_PRO_LINK' ) ) {
define('ARCHITECT_CIVIL_ENGINEER_PRO_LINK',__('https://www.ovationthemes.com/wordpress/engineer-wordpress-theme/','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_SUPPORT' ) ) {
define('CONSTRUCTION_FIRM_SUPPORT',__('https://wordpress.org/support/theme/architect-civil-engineer','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_REVIEW' ) ) {
define('CONSTRUCTION_FIRM_REVIEW',__('https://wordpress.org/support/theme/architect-civil-engineer/reviews/#new-post','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_LIVE_DEMO' ) ) {
define('CONSTRUCTION_FIRM_LIVE_DEMO',__('https://www.ovationthemes.com/demos/architect-civil-engineer/','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_BUY_PRO' ) ) {
define('CONSTRUCTION_FIRM_BUY_PRO',__('https://www.ovationthemes.com/wordpress/engineer-wordpress-theme/','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_PRO_DOC' ) ) {
define('CONSTRUCTION_FIRM_PRO_DOC',__('https://ovationthemes.com/docs/ot-architect-civil-engineer-pro-doc/','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_FREE_DOC' ) ) {
define('CONSTRUCTION_FIRM_FREE_DOC',__('https://ovationthemes.com/docs/ot-architect-civil-engineer-free-doc','architect-civil-engineer'));
}
if ( ! defined( 'CONSTRUCTION_FIRM_THEME_NAME' ) ) {
define('CONSTRUCTION_FIRM_THEME_NAME',__('Premium Architect Civil Engineer Theme','architect-civil-engineer'));
}
/* 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(){?>