for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports custom background color and image. $defaults = array( 'default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 972, 9999 ); // This theme uses a custom header background image. $args = array( 'width' => 1012, 'height' => 400, 'flex-width' => true, 'flex-height' => true, 'header-text' => false, 'random-default' => true,); add_theme_support( 'custom-header', $args ); add_theme_support( 'title-tag' ); add_theme_support( 'woocommerce' ); global $content_width; if ( ! isset( $content_width ) ) { $content_width = 616; } } add_action( 'after_setup_theme', 'brickyard_setup' ); /** * Enqueues scripts and styles for front-end. * */ function brickyard_scripts_styles() { global $wp_styles, $wp_scripts; // Adds JavaScript if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'brickyard-placeholders', get_template_directory_uri() . '/js/placeholders.js', array(), '3.0.2', true ); wp_enqueue_script( 'brickyard-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array( 'jquery' ), '1.0', true ); if ( !is_page_template('template-landing-page.php') ) { wp_enqueue_script( 'brickyard-menubox', get_template_directory_uri() . '/js/menubox.js', array( 'jquery' ), '1.0', true ); } wp_enqueue_script( 'brickyard-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true ); wp_enqueue_script( 'brickyard-responsive', get_template_directory_uri() . '/js/responsive.js', array(), '1.0', true ); wp_enqueue_script( 'brickyard-html5-ie', get_template_directory_uri() . '/js/html5.js', array(), '3.6', false ); $wp_scripts->add_data( 'brickyard-html5-ie', 'conditional', 'lt IE 9' ); // Loads the main stylesheet. wp_enqueue_style( 'brickyard-style', get_stylesheet_uri() ); wp_enqueue_style( 'brickyard-google-font-default', '//fonts.googleapis.com/css?family=Oswald&subset=latin,latin-ext' ); if ( class_exists( 'woocommerce' ) ) { wp_enqueue_style( 'brickyard-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css' ); } } add_action( 'wp_enqueue_scripts', 'brickyard_scripts_styles' ); /** * Backwards compatibility for older WordPress versions which do not support the Title Tag feature. * */ if ( ! function_exists( '_wp_render_title_tag' ) ) { function brickyard_wp_title( $title, $sep ) { if ( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; return $title; } add_filter( 'wp_title', 'brickyard_wp_title', 10, 2 ); } /** * Register our menus. * */ function brickyard_register_my_menus() { register_nav_menus( array( 'main-navigation' => __( 'Main Header Menu', 'brickyard' ), 'top-navigation' => __( 'Top Header Menu', 'brickyard' ) ) ); } add_action( 'after_setup_theme', 'brickyard_register_my_menus' ); /** * Register our sidebars and widgetized areas. * */ function brickyard_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'brickyard' ), 'id' => 'sidebar-1', 'description' => __( 'Right sidebar which appears on all posts and pages.', 'brickyard' ), 'before_widget' => '
', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer left widget area', 'brickyard' ), 'id' => 'sidebar-2', 'description' => __( 'Left column with widgets in footer.', 'brickyard' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer middle widget area', 'brickyard' ), 'id' => 'sidebar-3', 'description' => __( 'Middle column with widgets in footer.', 'brickyard' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer right widget area', 'brickyard' ), 'id' => 'sidebar-4', 'description' => __( 'Right column with widgets in footer.', 'brickyard' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer notices', 'brickyard' ), 'id' => 'sidebar-5', 'description' => __( 'The line for copyright and other notices below the footer widget areas. Insert here one Text widget. The "Title" field at this widget should stay empty.', 'brickyard' ), 'before_widget' => '', 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'Latest Posts Homepage widget area', 'brickyard' ), 'id' => 'sidebar-6', 'description' => __( 'The area for any BrickYard Posts Widgets, which displays latest posts from a specific category below the default Latest Posts area.', 'brickyard' ), 'before_widget' => '', '' ); ?>