<?php
/////////////////////////////

# THEME SUPPORT

/////////////////////////////
if(function_exists('add_theme_support')){
	
	///////////////////////////
    # Add Menu Support
	///////////////////////////
    add_theme_support('menus');

	/////////////////////////////////
    # Add Thumbnail Support
	/////////////////////////////////
    add_theme_support('post-thumbnails');
    add_image_size('large', 700, '', true); 	  // Large Thumbnail
    add_image_size('medium', 250, '', true);	 // Medium Thumbnail
    add_image_size('small', 120, '', true); 	// Small Thumbnail
    add_image_size('custom-size', 700, 200, true); // Custom Thumbnail Size call using the_post_thumbnail('custom-size');
	
	//////////////////////////////////////////////////////
    # Enable post and comment RSS feed links to head
	//////////////////////////////////////////////////////
    add_theme_support('automatic-feed-links');
	
	///////////////////////////
    # Localisation Support
	///////////////////////////
    load_theme_textdomain('theme', get_template_directory() . '/languages');
	
	///////////////////////////
    # Post Format Support
	///////////////////////////
	add_theme_support( 
		'post-formats',
		array(
			'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',
		)
	);
	
	///////////////////////////////////////////
    # Add Support for Custom Backgrounds
	///////////////////////////////////////////
    /*
		add_theme_support(
			'custom-background', 
			array(
				'default-color' => 'FFF',
				'default-image' => get_template_directory_uri() . '/img/bg.jpg'
			)
		);
	*/

	///////////////////////////////////////////
	# Add Support for Custom Header
	///////////////////////////////////////////
	/*
	add_theme_support(
		'custom-header', array(
			'default-image'			=> get_template_directory_uri() . '/img/headers/default.jpg',
			'header-text'			=> false,
			'default-text-color'	=> '000',
			'width'					=> 1000,
			'height'				=> 198,
			'random-default'		=> false,
			'wp-head-callback'		=> $wphead_cb,
			'admin-head-callback'	=> $adminhead_cb,
			'admin-preview-callback' => $adminpreview_cb
		)
	);*/
}

/////////////////////////////////////////

# REMOVE HOOKED ACTIONS & FILTERS

/////////////////////////////////////////
	///////////////////////
	# Remove Actions/Filters
	///////////////////////
	remove_action('wp_head', 'feed_links_extra', 3); 			// Display the links to the extra feeds such as category feeds
	remove_action('wp_head', 'feed_links', 2); 					// Display the links to the general feeds: Post and Comment Feed
	remove_action('wp_head', 'rsd_link'); 						// Display the link to the Really Simple Discovery service endpoint, EditURI link
	remove_action('wp_head', 'wlwmanifest_link'); 				// Display the link to the Windows Live Writer manifest file.
	remove_action('wp_head', 'index_rel_link'); 				// Index link
	remove_action('wp_head', 'parent_post_rel_link', 10, 0); 	// Prev link
	remove_action('wp_head', 'start_post_rel_link', 10, 0); 	// Start link
	remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // Display relational links for the posts adjacent to the current post.
	remove_action('wp_head', 'wp_generator'); 					// Display the XHTML generator that is generated on the wp_head hook, WP version
	remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
	remove_action('wp_head', 'rel_canonical');
	remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
	remove_filter('the_excerpt', 'wpautop'); // Remove <p> tags from Excerpt altogether

/////////////////////////////////////////

# ADD FILTERS

/////////////////////////////////////////
	/////////////////////
	# Add Filters
	/////////////////////
	add_filter('widget_text', 'do_shortcode'); 					// Allow shortcodes in Dynamic Sidebar
	add_filter('widget_text', 'shortcode_unautop'); 			// Remove <p> tags in Dynamic Sidebars (better!)
	add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args'); 		// Remove surrounding <div> from WP Navigation
	// add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); 				// Remove Navigation <li> injected classes (Commented out by default)
	// add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); 				// Remove Navigation <li> injected ID (Commented out by default)
	// add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); 					// Remove Navigation <li> Page ID's (Commented out by default)
	add_filter('the_excerpt', 'shortcode_unautop'); 			// Remove auto <p> tags in Excerpt (Manual Excerpts only)
	add_filter('the_excerpt', 'do_shortcode'); 					// Allows Shortcodes to be executed in Excerpt (Manual Excerpts only)
 
?>