<?php
/*
All the functions are in the PHP pages in the `functions/` folder.
*/

	require get_template_directory() . '/functions/cleanup.php';  
	require get_template_directory() . '/functions/setup.php';  
	require get_template_directory() . '/functions/enqueues.php';  
	require get_template_directory() . '/functions/navbar.php';  
	require get_template_directory() . '/functions/widgets.php';  
	require get_template_directory() . '/functions/search-widget.php';  
	require get_template_directory() . '/functions/index-pagination.php'; 
	require get_template_directory() . '/functions/split-post-pagination.php';  
	require get_template_directory() . '/functions/feedback.php';  
	require get_template_directory() . '/functions/remove-query-string.php';  
	
	add_theme_support( 'title-tag' );			
	add_theme_support( 'automatic-feed-links' );			
	if (!function_exists('fc_benews_themes_setup')) {
	function fc_benews_themes_setup() { 
		add_theme_support('title-tag');
		add_theme_support('automatic-feed-links');
		add_theme_support('html5', array('search-form'));
		add_theme_support('custom-background', array('default-color' => 'efefef')); 
		add_theme_support('custom-header', array('default-image' => '', 'default-text-color' => '1f1e1e', 'width' => 300, 'height' => 100, 'flex-width' => true, 'flex-height' => true));
		//add_image_size('content-single', 777, 437, true);
		register_nav_menus(array('footer_nav' => __('Footer Navigation', 'javtheme')));
		//add_filter('use_default_gallery_style', '__return_false');
		add_filter('widget_text', 'do_shortcode');
	}
}
add_action('after_setup_theme', 'fc_benews_themes_setup');
function fc_excerpt_more( $more ) {
    return '...';
}
add_filter( 'excerpt_more', 'fc_excerpt_more' );

function fc_error_notice() {
  ?>
  <div class="updated notice">
   <p><a href="http://javtheme.com/contact-us/" target="_blank">Recommended Hosting from javtheme.com</a></p>
   <p><a href="http://javtheme.com/contact-us/" target="_blank">WordPress professional services with javtheme.com</a></p>
   <p>Email to me <a href="mailto:denphan2911@gmail.com" target="_blank">Here</a> (denphan2911@gmail.com)</p>
  </div>
  <?php
 }
 add_action( 'admin_notices', 'fc_error_notice' );




add_action('customize_register', 'fc_theme_footer_customizer');
function fc_theme_footer_customizer($wp_customize){ 
	$wp_customize->add_section('logo_section', array(
	  'title'          => 'Logo',
	  'priority' => 30,
	 ));
	
	$wp_customize->add_setting('site_logo' , array(
		'default' => '',
		'sanitize_callback' => 'esc_url',
	));
	$wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize,'site_logo',array(
	 'label'      => __('Logo', 'javtheme'),
	 'section'    => 'logo_section',
	 'settings'   => 'site_logo',
	 )));
	
	
	$wp_customize->add_section('footer_section', array(
	  'title'          => 'Footer',
	  'priority' => 160,
	 ));
	 
	$wp_customize->add_setting( 'footer_copyright' , array(
		'default' => '© 2017 Left Style - Theme framework by javtheme.com', 
		'sanitize_callback' => 'esc_attr',
	) );
	$wp_customize->add_control(new WP_Customize_Control($wp_customize,'footer_copyright',array(
	 'label'      => __('Copyright', 'javtheme'),
	 'section'    => 'footer_section',
	 'settings'   => 'footer_copyright',
	 )));
	
	
	
};

	
 

	/**
	 * Load request plugin.
	 */
	/* TGM Plugin Activation */
	require_once dirname(__FILE__) . '/class-tgm-plugin-activation.php';

	add_action('tgmpa_register', 'my_plugin_activation');

	function my_plugin_activation() {

		$plugins = array( 
			array(
				'name' => 'Contact Form 7',
				'slug' => 'contact-form-7',
				'required' => false,
				),
			array(
				'name' => 'MailChimp for WordPress',
				'slug' => 'mailchimp-for-wp',
				'required' => false,
				),
			array(
				'name' => 'Instagram Feed',
				'slug' => 'instagram-feed',
				'required' => false,
				),
			 
		); // end $plugins

		$config = array(
			'default_path' => '',
			'menu' => 'tgmpa-install-plugins', // Menu slug.
			'has_notices' => true,
			'dismissable' => true,
			'dismiss_msg' => '',
			'is_automatic' => false,
			'message' => '',
	 
		); // end $config
	tgmpa($plugins, $config);
	}