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', 'halcyon' ), ) ); /* * 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', ) ); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'halcyon_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /* Custom Logo */ add_theme_support( 'custom-logo', array( 'width' => 230, 'height' => 50, 'header-text' => array( 'site-title', 'site-description' ), ) ); //Custom Image Sizes add_image_size( 'halcyon-slider', 1400, 500, true ); add_image_size( 'halcyon-slider-thumb', 160, 90, true ); add_image_size( 'halcyon-featured-post', 360, 290, true ); add_image_size( 'halcyon-recent-post', 360, 160, true ); add_image_size( 'halcyon-widget-post', 320, 320, true ); add_image_size( 'halcyon-with-sidebar', 750, 450, true ); add_image_size( 'halcyon-without-sidebar', 1170, 450, true ); } endif; add_action( 'after_setup_theme', 'halcyon_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 halcyon_content_width() { $GLOBALS['content_width'] = apply_filters( 'halcyon_content_width', 750 ); } add_action( 'after_setup_theme', 'halcyon_content_width', 0 ); /** * Adjust content_width value according to template. * * @return void */ function halcyon_template_redirect_content_width() { // Full Width in the absence of sidebar. if( is_page() ){ $sidebar_layout = halcyon_sidebar_layout(); if( ( $sidebar_layout == 'no-sidebar' ) || ! ( is_active_sidebar( 'right-sidebar' ) ) ) $GLOBALS['content_width'] = 1170; }elseif ( ! ( is_active_sidebar( 'right-sidebar' ) ) ) { $GLOBALS['content_width'] = 1170; } } add_action( 'template_redirect', 'halcyon_template_redirect_content_width' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function halcyon_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Right Sidebar', 'halcyon' ), 'id' => 'right-sidebar', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer One', 'halcyon' ), 'id' => 'footer-one', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Two', 'halcyon' ), 'id' => 'footer-two', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Three', 'halcyon' ), 'id' => 'footer-three', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'halcyon_widgets_init' ); /** * Enqueue scripts and styles. */ function halcyon_scripts() { $halcyon_query_args = array( 'family' => 'Raleway:400,500,600,700|Lato:400,700', ); wp_enqueue_style( 'halcyon-google-fonts', add_query_arg( $halcyon_query_args, "//fonts.googleapis.com/css" ) ); wp_enqueue_style( 'halcyon-font-awesome', get_template_directory_uri() . '/css/font-awesome.css' ); wp_enqueue_style( 'halcyon-jcf-style', get_template_directory_uri() . '/css/jcf.css' ); wp_enqueue_style( 'halcyon-meanmenu-style', get_template_directory_uri() . '/css/meanmenu.css' ); wp_enqueue_style( 'halcyon-aw-showcase-style', get_template_directory_uri() . '/css/aw-showcase.css' ); wp_enqueue_style( 'halcyon-style', get_stylesheet_uri() ); wp_enqueue_script( 'halcyon-meanmenu', get_template_directory_uri() . '/js/jquery.meanmenu.js', array('jquery'), '2.0.8', true ); wp_enqueue_script( 'halcyon-aw-showcase', get_template_directory_uri() . '/js/jquery.aw-showcase.js', array('jquery'), '1.1.1', true ); wp_enqueue_script( 'halcyon-jcf', get_template_directory_uri() . '/js/jcf.js', array('jquery'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-checkbox', get_template_directory_uri() . '/js/jcf.checkbox.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-file', get_template_directory_uri() . '/js/jcf.file.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-number', get_template_directory_uri() . '/js/jcf.number.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-radio', get_template_directory_uri() . '/js/jcf.radio.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-range', get_template_directory_uri() . '/js/jcf.range.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-jcf-select', get_template_directory_uri() . '/js/jcf.select.js', array('jquery', 'halcyon-jcf'), '1.2.0', true ); wp_enqueue_script( 'halcyon-custom', get_template_directory_uri() . '/js/custom.js', array('jquery'), '20160114', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'halcyon_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 Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /** * Widget Recent Post */ require get_template_directory() . '/inc/widget-recent-post.php'; /** * Widget Featured Post */ require get_template_directory() . '/inc/widget-featured-post.php'; /** * Widget Popular Post */ require get_template_directory() . '/inc/widget-popular-post.php'; /** * Widget Social Links */ require get_template_directory() . '/inc/widget-social-links.php'; /** * Meta Box */ require get_template_directory() . '/inc/metabox.php';