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' ); add_image_size( 'blogyard-promo-post', 360, 261, array( 'left', 'bottom' ) ); //(cropped) // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'blogyard' ), 'secondary' => esc_html__( 'Secondary', 'blogyard' ), 'social' => esc_html__( 'Social', 'blogyard' ) ) ); /* * Theme custom logo */ add_theme_support( 'custom-logo', array( 'height' => 70, 'width' => 250, 'flex-width' => true, ) ); /* * 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://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'blogyard_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; add_action( 'after_setup_theme', 'blogyard_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 blogyard_content_width() { $GLOBALS['content_width'] = apply_filters( 'blogyard_content_width', 640 ); } add_action( 'after_setup_theme', 'blogyard_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function blogyard_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'blogyard' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'blogyard' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 1st column', 'blogyard' ), 'id' => 'footer-1', 'description' => esc_html__( 'Add widgets here', 'blogyard' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2nd column', 'blogyard' ), 'id' => 'footer-2', 'description' => esc_html__( 'Add widgets here', 'blogyard' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3rd column', 'blogyard' ), 'id' => 'footer-3', 'description' => esc_html__( 'Add widgets here', 'blogyard' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4th column', 'blogyard' ), 'id' => 'footer-4', 'description' => esc_html__( 'Add widgets here', 'blogyard' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'blogyard_widgets_init' ); /** * Enqueue scripts and styles. */ function blogyard_scripts() { /*google font */ wp_enqueue_style( 'blogyard-googleapis', 'https://fonts.googleapis.com/css?family=Fauna+One|Open+Sans', array(), null ); /*Font-Awesome-master*/ wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/framework/Font-Awesome/css/font-awesome.min.css', array(), '4.5.0' ); /*Bootstrap CSS*/ wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/framework/bootstrap/css/bootstrap.min.css', array(), '4.5.0' ); /*Owl CSS*/ wp_enqueue_style( 'owl-carousel', get_template_directory_uri() . '/assets/framework/owl-carousel/owl.carousel.css', array(), '4.5.0' ); /*Fancybox CSS*/ wp_enqueue_style( 'fancybox', get_template_directory_uri() . '/assets/framework/fancybox/css/jquery.fancybox.css', array(), '4.5.0' ); /*Style CSS*/ wp_enqueue_style( 'blogyard-style', get_stylesheet_uri() , '' , '1.0.2' ); /*Bootstrap JS*/ wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/framework/bootstrap/js/bootstrap.min.js', array('jquery'), '3.3.7' , true ); /*navigation JS*/ wp_enqueue_script( 'blogyard-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array('jquery'), '20151215', true ); /*owl*/ wp_enqueue_script( 'jquery-owl-carousel', get_template_directory_uri() . '/assets/framework/owl-carousel/owl.carousel.min.js', array('jquery'), '1.3.3' , true ); /*fancybox js*/ wp_enqueue_script( 'jquery-fancybox', get_template_directory_uri() . '/assets/framework/fancybox/js/jquery.fancybox.pack.js', array('jquery'), '2.1.7' , true ); /*Sticky Sidebar js*/ wp_enqueue_script( 'jquery-sticky-sidebar', get_template_directory_uri() . '/assets/js/theia-sticky-sidebar.js', array('jquery'), '1.4.0' , true ); /*Custom JS*/ wp_enqueue_script( 'blogyard-scripts', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '1.0.2' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'blogyard_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'; /** * Loading related post file */ require get_template_directory() . '/inc/hooks/related-post.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Loading breadcrumbs File. */ if (!function_exists('breadcrumb_trail')) { require get_template_directory() . '/inc/library/breadcrumbs/breadcrumbs.php'; } /** * Loading page-breadcrumbs in pages/posts */ require get_template_directory() . '/inc/hooks/page-breadcrumbs.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /** * Load theme-function file. */ require get_template_directory() . '/inc/theme-function.php'; /** * Load Custom widget File. */ require get_template_directory() . '/inc/widgets/social-widget.php'; /* Function to load admin js */ if( !function_exists( 'blogyard_author_widgets_backend_enqueue' )): function blogyard_admin_enqueue($hook){ if ( 'widgets.php' != $hook) { return; } wp_enqueue_script( 'blogyard-custom-widgets', get_template_directory_uri().'/assets/js/widgets-admin.js', array( 'jquery' ), true ); wp_enqueue_media(); } add_action( 'admin_enqueue_scripts', 'blogyard_admin_enqueue' ); endif;