for posts and comments. add_theme_support('automatic-feed-links'); // Enable support for Post Thumbnails, and declare thumbnail sizes. add_theme_support('post-thumbnails'); set_post_thumbnail_size(1440, 480, FALSE); // This theme uses wp_nav_menu() in two locations. register_nav_menus(array( 'main_menu' => __('Top Primary Menu', 'bigblank'), 'footer_menu' => __('Footer Menu', 'bigblank'), )); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array( 'search-form', 'comment-form', 'comment-list', )); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); // add custom metaboxs and save the data add_action('add_meta_boxes', 'bigblank_add_custom_box'); add_action('save_post', 'bigblank_save_post'); } endif; // bigblank_setup add_action('after_setup_theme', 'bigblank_setup'); /** * Adjust content_width value for image attachment template. * * * @return void */ function bigblank_content_width() { if (is_attachment() && wp_attachment_is_image()) { $GLOBALS['content_width'] = 960; } } add_action('template_redirect', 'bigblank_content_width'); /** * Let's remove some code and cleanup */ function bigblank_head_cleanup() { /** * remove Really Simple Discoverability; Roll it in if you want to use * Weblog Clients that use XML-RPC Support * @link http://codex.wordpress.org/XML-RPC_Support */ remove_action('wp_head', 'rsd_link'); // remove Windows Live Writer Manifest link remove_action('wp_head', 'wlwmanifest_link'); // remove WordPress version meta remove_action('wp_head', 'wp_generator'); } add_action('init', 'bigblank_head_cleanup'); /** * Remove version from CSS and JS files for Caching * @param string|array $src Query key or keys to remove. * @return string New URL query string. */ function bigblank_remove_wp_ver_css_js($src) { if (strpos($src, 'ver=')) { $src = remove_query_arg('ver', $src); } return $src; } add_filter('style_loader_src', 'bigblank_remove_wp_ver_css_js'); add_filter('script_loader_src', 'bigblank_remove_wp_ver_css_js'); /** * Enqueue scripts and styles for the front end. * * Read more about wp_register_script at: * @link http://codex.wordpress.org/Function_Reference/wp_register_script * @return void */ function bigblank_scripts() { // Load our main stylesheet. wp_enqueue_style('style', get_stylesheet_uri()); // Load the Internet Explorer specific stylesheet. wp_enqueue_style('ie-styles', get_template_directory_uri() . '/css/ie.css', false, '20140416'); wp_style_add_data('ie-styles', 'conditional', 'lt IE 9'); // jQuery.js // 1. load the latest jQuery from theme library // wp_deregister_script('jquery'); // wp_register_script('jquery', get_template_directory_uri() . '/js/jquery.js', false, '2.1.0', true); // 2. load from Google CDN // wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', false, false, true); // 3. load from WP included library, Loading jQuery in footer sometimes causes // for some plugins to not work since they do not register jQuery as dependancy // wp_register_script('jquery', false, false, false, true); // 4. or do nothing and jQuery will load from current WordPress install if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply', false, false, false, true); } wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.min.js', array('jquery'), '20140222', true); wp_enqueue_script('main', get_template_directory_uri() . '/js/main.js', array('jquery', 'scripts'), '20140222', true); } add_action('wp_enqueue_scripts', 'bigblank_scripts'); // Widgets and Sidebars require_once(get_template_directory() . '/inc/widget-title.php'); require_once(get_template_directory() . '/inc/widget-call-to-action.php'); require_once(get_template_directory() . '/inc/widgets-sidebars.php'); // Custom post types & Taxanomies require_once(get_template_directory() . '/inc/custom-post-types.php'); require_once(get_template_directory() . '/inc/custom-taxanomies.php'); // Filters and functions to manipulate content require_once(get_template_directory() . '/inc/filters.php'); // Custom template tags for this theme. require_once(get_template_directory() . '/inc/template-tags.php'); // Custom shortcodes. require_once(get_template_directory() . '/inc/shortcodes.php'); // Add Theme Customizer functionality. require_once(get_template_directory() . '/inc/admin-customizer.php'); // Modify TinyMCE to accomodate custom styles require_once(get_template_directory() . '/inc/admin-editor.php'); // Add Schema.org MicroData to our content require_once(get_template_directory() . '/inc/schema.php');