for posts and comments. add_theme_support( 'automatic-feed-links' ); // Switches 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 supports all available post formats by default. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'audio', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Navigation Menu', 'mckinley' ) ); /** * Add support for custom backgrounds */ add_theme_support( 'custom-background' ); /* * This theme uses a custom image size for featured images, displayed on * "standard" posts and pages. */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1000, 500, true ); add_image_size('mckinley-post-thumb-big', 1000, 500, true); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); } add_action( 'after_setup_theme', 'mckinley_setup' ); /** * Returns the Google font stylesheet URL, if available. * * The use of Raleway by default is localized. For languages * that use characters not supported by the font, the font can be disabled. * * @since McKinley 1.0 * * @return string Font stylesheet or empty string if disabled. */ function mckinley_fonts() { /* translators: If there are characters in your language that are not supported by Raleway, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Raleway font: on or off', 'mckinley' ) ) { wp_register_style( 'mckinley-raleway', "https://fonts.googleapis.com/css?family=Raleway:400,700,800,900", array(), null ); } /* translators: If there are characters in your language that are not supported by Open Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'mckinley' ) ) { wp_register_style( 'mckinley-open-sans', "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,800,700", array(), null ); } } add_action( 'init', 'mckinley_fonts' ); /** * Enqueues scripts and styles for front end. * * @since McKinley 1.0 * * @return void */ function mckinley_scripts_styles() { // Adds JavaScript to pages with the comment form to support sites with // threaded comments (when in use). if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // Adds Masonry to handle vertical alignment of footer widgets. if ( is_active_sidebar( 'sidebar-1' ) ) { wp_enqueue_script( 'masonry' ); } // Loads JavaScript file with functionality specific to McKinley. wp_enqueue_script( 'mckinley-script', get_template_directory_uri() . '/js/mckinley.js', array( 'jquery' ), '20130718', true ); // Loads Flexslider for gallery slideshow. wp_enqueue_style('flexslider', get_template_directory_uri().'/css/flexslider.css', false, '2.0', 'all' ); wp_enqueue_script('flexslider-script', get_template_directory_uri().'/js/jquery.flexslider.js', array('jquery'), '2.0', true); // Add Raleway and Open Sans fonts, used in the main stylesheet. wp_enqueue_style( 'mckinley-raleway' ); wp_enqueue_style( 'mckinley-open-sans' ); // Add Genericons font, used in the main stylesheet. if ( wp_style_is( 'genericons', 'registered' ) ) wp_enqueue_style( 'genericons' ); else wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), null ); // Loads our main stylesheet. wp_enqueue_style( 'mckinley-style', get_stylesheet_uri(), array(), '20130718' ); } add_action( 'wp_enqueue_scripts', 'mckinley_scripts_styles' ); /** * Registers two widget areas. * * @since McKinley 1.0 * * @return void */ function mckinley_widgets_init() { register_sidebar( array( 'name' => __( 'Footer Widget Area', 'mckinley' ), 'id' => 'sidebar-1', 'description' => __( 'Appears in the footer section of the site.', 'mckinley' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'mckinley_widgets_init' ); /** * Customizer additions */ require get_template_directory() . '/inc/customizer.php'; /** * Template tags */ require get_template_directory() . '/inc/template-tags.php'; /** * Extras */ require get_template_directory() . '/inc/extras.php'; /** * Template tags */ require get_template_directory() . '/inc/custom-header.php'; /** * Load Jetpack compatibility file. */ if ( file_exists( get_template_directory() . '/inc/jetpack.php' ) ) require get_template_directory() . '/inc/jetpack.php';