55, 'width' => 135, 'flex-width' => true, ) ); add_theme_support( 'custom-header', apply_filters( 'atlas_custom_header_args', array( 'default-image' => '', 'default-text-color' => '000000', 'width' => 1900, 'height' => 225, 'flex-width' => true ) ) ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'atlas' ), 'social-menu' => esc_html__( 'Social Menu', 'atlas' ), ) ); /* * 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', 'gallery', 'caption', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'atlas_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /** * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); add_image_size( 'atlas-full', 1110, 530, true ); add_image_size( 'atlas-featured', 730, 350, true ); add_image_size( 'atlas-grid', 350, 300, true ); add_theme_support( 'customize-selective-refresh-widgets' ); // Welcome screen if ( is_admin() ) { global $atlas_required_actions, $atlas_recommended_plugins; $atlas_recommended_plugins = array( 'wordpress-seo' => array( 'recommended' => true ), 'fancybox-for-wordpress' => array( 'recommended' => false ), ); /* * id - unique id; required * title * description * check - check for plugins (if installed) * plugin_slug - the plugin's slug (used for installing the plugin) * */ $path = WPMU_PLUGIN_DIR . '/atlas-companion/inc/views/atlas-demo-content.php'; if ( ! file_exists( $path ) ) { $path = WP_PLUGIN_DIR . '/atlas-companion/inc/views/atlas-demo-content.php'; if ( ! file_exists( $path ) ) { $path = false; } } } } endif; add_action( 'after_setup_theme', 'atlas_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function atlas_content_width() { $GLOBALS['content_width'] = apply_filters( 'atlas_content_width', 1140 ); } add_action( 'after_setup_theme', 'atlas_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function atlas_widgets_init() { register_sidebar( array( 'id' => 'sidebar-1', 'name' => __( 'Sidebar', 'atlas' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'id' => 'sidebar-home', 'name' => __( 'Homepage', 'atlas' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); for ( $i = 1; $i < 5; $i ++ ) { register_sidebar( array( 'id' => 'footer-widget-' . $i, 'name' => sprintf( __( 'Footer Widget %s', 'atlas' ), $i ), 'description' => __( 'Used for footer widget area', 'atlas' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); } } add_action( 'widgets_init', 'atlas_widgets_init' ); /** * Hides the custom post template for pages on WordPress 4.6 and older * * @param array $post_templates Array of page templates. Keys are filenames, values are translated names. * * @return array Filtered array of page templates. */ function atlas_exclude_page_templates( $post_templates ) { if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) { unset( $post_templates['page-templates/full-width.php'] ); unset( $post_templates['page-templates/no-sidebar.php'] ); unset( $post_templates['page-templates/sidebar-left.php'] ); unset( $post_templates['page-templates/sidebar-right.php'] ); } return $post_templates; } add_filter( 'theme_page_templates', 'atlas_exclude_page_templates' ); /** * Enqueue scripts and styles. */ function atlas_scripts() { // Add Bootstrap default CSS wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/inc/css/bootstrap.min.css' ); // Add Font Awesome stylesheet wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/inc/css/font-awesome.min.css' ); // Add Google Fonts wp_enqueue_style( 'atlas-fonts', '//fonts.googleapis.com/css?family=Raleway:100,300,400,500,600,700%7COpen+Sans:400,500,600' ); // Add slider CSS wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/inc/css/flexslider.css' ); //Add custom theme css wp_enqueue_style( 'atlas-style', get_stylesheet_uri() ); wp_enqueue_script( 'atlas-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'atlas-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20160115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( post_type_exists( 'jetpack-portfolio' ) ) { wp_enqueue_script( 'jquery-masonry' ); } // Add slider JS wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.min.js', array( 'jquery' ), '20160222', true ); if ( is_page_template( 'template-home.php' ) ) { wp_enqueue_script( 'atlas-parallax', get_template_directory_uri() . '/js/parallax.min.js', array( 'jquery' ), '20160115', true ); } /** * OwlCarousel Library */ wp_enqueue_script( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.carousel.min.js', array( 'jquery' ), '20160115', true ); wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.carousel.min.css' ); wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.theme.default.css' ); wp_enqueue_script( 'atlas-scripts', get_template_directory_uri() . '/js/atlas-scripts.js', array( 'jquery' ), '20160115', true ); } add_action( 'wp_enqueue_scripts', 'atlas_scripts' ); /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load custom nav walker */ require get_template_directory() . '/inc/navwalker.php'; /** * Load Social Navition */ require get_template_directory() . '/inc/socialnav.php'; /** * Load related posts */ require get_template_directory() . '/inc/class-atlas-related-posts.php'; /** * Load related posts */ require get_template_directory() . '/inc/jetpack.php';