<?php
/**
 * Theme Functions.
 */

/* Theme Setup */
if ( ! function_exists( 'advance_consultancy_setup' ) ) :

function advance_consultancy_setup() {

	$GLOBALS['content_width'] = apply_filters( 'advance_consultancy_content_width', 640 );

	add_theme_support( 'automatic-feed-links' );
	add_theme_support( 'post-thumbnails' );
	add_theme_support( 'align-wide' );
	add_theme_support( 'wp-block-styles' );
	add_theme_support( 'title-tag' );
	add_theme_support( 'custom-logo', array(
		'height'      => 240,
		'width'       => 240,
		'flex-height' => true,
	) );

	add_theme_support( 'custom-background', array(
		'default-color' => 'f1f1f1'
	) );

	add_theme_support( 'html5', array(
		'comment-form',
		'comment-list',
		'gallery',
		'caption',
	) );

	add_theme_support('responsive-embeds');
	/*
	 * This theme styles the visual editor to resemble the theme style,
	 * specifically font, colors, icons, and column width.
	 */
	add_editor_style( array( 'css/editor-style.css', multi_advance_font_url() ) );
}
endif;
add_action( 'after_setup_theme', 'advance_consultancy_setup' );

/* Theme Widgets Setup */
function advance_consultancy_widgets_init() {

	register_sidebar( array(
		'name'          => __( 'Footer Nav 1', 'advance-consultancy' ),
		'id'            => 'footer-1',
		'description'   => '',
		'before_widget' => '<aside id="%1$s" class="widget %2$s py-3">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h3 class="widget-title pb-2 mb-3">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer Nav 2', 'advance-consultancy' ),
		'id'            => 'footer-2',
		'description'   => '',
		'before_widget' => '<aside id="%1$s" class="widget %2$s py-3">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h3 class="widget-title pb-2 mb-3">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer Nav 3', 'advance-consultancy' ),
		'id'            => 'footer-3',
		'description'   => '',
		'before_widget' => '<aside id="%1$s" class="widget %2$s py-3">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h3 class="widget-title pb-2 mb-3">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer Nav 4', 'advance-consultancy' ),
		'id'            => 'footer-4',
		'description'   => '',
		'before_widget' => '<aside id="%1$s" class="widget %2$s py-3">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h3 class="widget-title pb-2 mb-3">',
		'after_title'   => '</h3>',
	) );
}
add_action( 'widgets_init', 'advance_consultancy_widgets_init' );

function advance_consultancy_customize_register() {     
	global $wp_customize;

	$wp_customize->remove_setting( 'multi_advance_footer_widget_areas' );
	$wp_customize->remove_control( 'multi_advance_footer_widget_areas' );	

	$wp_customize->remove_setting( 'multi_advance_display_topbar' );
	$wp_customize->remove_control( 'multi_advance_display_topbar' );	
} 
add_action( 'customize_register', 'advance_consultancy_customize_register', 11 );

define('ADVANCE_CONSULTANCY_CREDIT',__('https://www.themeshopy.com/themes/free-consultancy-wordpress-theme/', 'advance-consultancy'));

if (!function_exists('advance_consultancy_credit')) {
	function advance_consultancy_credit() {
		echo "<a href=".esc_url(ADVANCE_CONSULTANCY_CREDIT)." target='_blank''>".esc_html__('Advance Consultancy WordPress Theme', 'advance-consultancy')."</a>";
	}
}

add_action( 'wp_enqueue_scripts', 'advance_consultancy_enqueue_styles' );
function advance_consultancy_enqueue_styles() {
	wp_enqueue_style('bootstrap-style', get_template_directory_uri().'/css/bootstrap.css');
	$parent_style = 'multi-advance-basic-style'; // Style handle of parent theme.
	wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
	wp_enqueue_style( 'advance-consultancy-style', get_stylesheet_uri(), array( $parent_style ) );	
	require get_parent_theme_file_path( '/inc/ts-color-pallete.php' );
	wp_add_inline_style( 'advance-consultancy-style',$multi_advance_custom_css );
	require get_theme_file_path( '/ts-color-pallete.php' );
	wp_add_inline_style( 'advance-consultancy-style',$multi_advance_custom_css );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}

if ( ! defined( 'MULTI_ADVANCE_PRO_THEME_LINK' ) ) {
	define( 'MULTI_ADVANCE_PRO_THEME_LINK',__('https://www.themeshopy.com/themes/business-consultancy-wordpress-theme/','advance-consultancy') );
}
if ( ! defined( 'MULTI_ADVANCE_PRO_THEME_TEXT' ) ) {
	define( 'MULTI_ADVANCE_PRO_THEME_TEXT', __('Advance Consultancy Pro','advance-consultancy') );
}