get( 'Version' ); } endif; add_action( 'after_setup_theme', 'agencybell_setup' ); /** * remove parent actions */ add_action( 'init', 'agencybell_remove_action'); function agencybell_remove_action() { remove_action('construction_light_action_video_calltoaction','construction_light_video_calltoaction', 40); remove_action('construction_light_calltoaction_section','construction_light_calltoaction', 50); remove_action('construction_light_counter_section','construction_light_counter', 60); remove_action('construction_light_blog_section','construction_light_blog', 65); remove_action('construction_light_action_service_advance', 'construction_light_service_section', 45); } /** * Enqueue child theme styles and scripts */ function agencybell_scripts() { global $agencybell_version; wp_dequeue_style( 'construction-light-style' ); wp_enqueue_style( 'agencybell-parent-style', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'style.css', array(), esc_attr( $agencybell_version ) ); wp_enqueue_style( 'agencybell-style', get_stylesheet_uri(), esc_attr( $agencybell_version ) ); wp_add_inline_style('agencybell-style', agencybell_dymanic_styles()); wp_enqueue_style( 'agencybell-responsive', get_template_directory_uri(). '/assets/css/responsive.css'); wp_enqueue_script('agencybell', get_stylesheet_directory_uri() . '/js/agencybell.js', array('jquery','masonry'), esc_attr( $agencybell_version ), true); } add_action( 'wp_enqueue_scripts', 'agencybell_scripts', 20 ); if ( ! function_exists( 'agencybell_child_options' ) ) { function agencybell_child_options( $wp_customize ) { $wp_customize->remove_control("header_image"); $agencybell = $wp_customize->get_setting('construction_light_header_layout'); $agencybell->default = 'layout_three'; $agencybellchoices = $wp_customize->get_control('construction_light_header_layout'); $agencybellchoices->choices = array( 'layout_one' => esc_html__( 'Layout One', 'agencybell' ), 'layout_two' => esc_html__( 'Layout Two', 'agencybell' ), 'layout_three' => esc_html__( 'Layout Three', 'agencybell' ) ); /** * About Section */ $wp_customize->remove_control('construction_light_aboutus_image'); $wp_customize->remove_control('construction_light_aboutus_style'); $wp_customize->remove_control('construction_light_aboutus_text_color'); $wp_customize->remove_control('construction_light_aboutus_bg_color'); $agencybell = $wp_customize->get_setting('construction_light_aboutus_alignment'); $agencybell->default = 'text-center'; /** * Service Section Layout */ $agencybell = $wp_customize->get_setting('construction_light_service_layout'); $agencybell->default = 'layout_three'; $agencybellchoices = $wp_customize->get_control('construction_light_service_layout'); $agencybellchoices->choices = array( 'layout_one' => esc_html__( 'Layout One', 'agencybell' ), 'layout_two' => esc_html__( 'Layout Two', 'agencybell' ), 'layout_three' => esc_html__( 'Layout Three', 'agencybell' ) ); $wp_customize->add_setting('construction_light_service_image', array( 'sanitize_callback' => 'esc_url_raw' //done )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'construction_light_service_image', array( 'label' => esc_html__('Background Image','agencybell'), 'section' => 'construction_light_service_section', 'type' => 'image', 'priority' => 1 ))); /** * Remove Section */ $wp_customize->remove_section( 'construction_light_video_calltoaction_section'); $wp_customize->remove_section( 'construction_light_calltoaction_section'); $wp_customize->remove_section( 'construction_light_counter_section'); $wp_customize->remove_section( 'construction_light_blog_section'); } } add_action( 'customize_register' , 'agencybell_child_options', 11 ); /** * Our Service Featues Section. */ if (! function_exists( 'construction_light_promo_service' ) ): function construction_light_promo_service(){ $features_options = get_theme_mod('construction_light_features_service_section','enable'); if( !empty( $features_options ) && $features_options == 'enable' ){ ?>
promoservice_page; if (!empty($page_id)): $service_query = new WP_Query('page_id=' . $page_id); if ( $service_query->have_posts() ): while ( $service_query->have_posts() ): $service_query->the_post(); ?>

service_page; if (!empty($page_id)): $service_query = new WP_Query('page_id=' . $page_id); if ( $service_query->have_posts() ): while ( $service_query->have_posts() ): $service_query->the_post(); if( function_exists( 'pll_register_string' ) ){ $service_button = pll__( get_theme_mod( 'construction_light_service_button','Read More' ) ); }else{ $service_button = get_theme_mod( 'construction_light_service_button','Read More' ); } if($service_layout == 'layout_one' ){ ?>
'; foreach ($pages as $page): $page_id = $page->service_page; if (!empty($page_id)): $service_query = new WP_Query('page_id=' . $page_id); if ( $service_query->have_posts() ): while ( $service_query->have_posts() ): $service_query->the_post(); ?>
  • service_page; if (!empty($page_id)): $service_query = new WP_Query('page_id=' . $page_id); if ( $service_query->have_posts() ): while ( $service_query->have_posts() ): $service_query->the_post(); ?>
    "", // Strip C style comments. "#\s\s+#" => " ", // Strip excess whitespace. ); $search = array_keys($replace); $css = preg_replace($search, $replace, $css); $replace = array( ": " => ":", "; " => ";", " {" => "{", " }" => "}", ", " => ",", "{ " => "{", ";}" => "}", // Strip optional semicolons. ",\n" => ",", // Don't wrap multiple selectors. "\n}" => "}", // Don't wrap closing braces. "} " => "}\n", // Put each rule on it's own line. ); $search = array_keys($replace); $css = str_replace($search, $replace, $css); return trim($css); } /** * Dynamic Style */ function agencybell_dymanic_styles() { $services_bg = get_theme_mod('construction_light_service_image'); $customcss = " #cl_services{background-image: url(" . esc_url($services_bg) . "); background-size: cover; background-repeat: no-repeat;} "; return agencybell_css_strip_whitespace($customcss); } // Add specific CSS class by filter. add_filter( 'body_class', function( $classes ) { if( !get_theme_mod('construction_light_enable_frontpage', 0)){ return array_merge( $classes, array( 'nav-relateive' ) ); } return $classes; } );