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( 'befold-featured-thumb', 720, 480, true ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Header Menu', 'befold' ), 'footer_menu' => __( 'Footer Menu', 'befold' ), ) ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'befold_custom_background_args', array( 'default-color' => '#18191b', 'default-image' => '', ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'image' ) ); $header_bg = array( 'default-image' => get_template_directory_uri() . '/assets/images/header_bg.jpg', 'width' => 1500, 'height' => 500, 'flex-height' => true, 'flex-width' => true ); $logo = array( 'height' => 240, 'width' => 240, 'flex-height' => true ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'align-wide' ); add_theme_support( 'custom-background' ); add_theme_support( 'custom-header',$header_bg); add_theme_support( 'custom-logo',$logo); remove_theme_support( 'widgets-block-editor' ); } endif; // befold_setup add_action( 'after_setup_theme', 'befold_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 $befold_content_width */ function befold_content_width() { $GLOBALS['befold_content_width'] = apply_filters( 'befold_content_width', 1140 ); } add_action( 'after_setup_theme', 'befold_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function befold_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'befold' ), 'id' => 'sidebar-right', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'befold_widgets_init' ); /** * Enqueue scripts and styles. */ function befold_scripts() { wp_enqueue_style( 'befold-bootstrap', get_template_directory_uri() . '/assets/plugins/css/bootstrap.min.css', array(), '3.3.6' ); wp_enqueue_style( 'befold-font-awesome', get_template_directory_uri() . '/assets/plugins/css/font.awesome.min.css', array(), '4.5.0' ); wp_enqueue_style( 'befold-gutenberg', get_template_directory_uri() . '/assets/admin/css/gutenberg-style.css', array(), '3.3.6' ); wp_enqueue_style( 'befold-style', get_stylesheet_uri() ); wp_enqueue_style( 'befold-editor', get_template_directory_uri() . '/assets/admin/css/custom.css', array(), befold_get_version() ); wp_enqueue_style( 'befold-responsive', get_template_directory_uri() . '/assets/css/responsive.css', array(), befold_get_version()); wp_enqueue_script( 'befold-jRespond', get_template_directory_uri() . '/assets/plugins/js/jrespond.min.js', array(), '0.10', true ); wp_enqueue_script( 'befold-keyboard-navigation', get_template_directory_uri() . '/assets/js/keyboard-navigation.js', array(), befold_get_version(), true ); wp_enqueue_script( 'befold-app', get_template_directory_uri() . '/assets/js/app.js', array( 'jquery' ), befold_get_version(), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Localize the script with new data. wp_localize_script( 'befold-app', 'befold_app_vars', array( 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' )), 'home_url' => esc_url( home_url( '/' ) ), 'current_page_url' => esc_url( befold_get_current_url()), 'accent_color' => '#ff4070', 'nonce' => wp_create_nonce('ajax-nonce') ) ); // Custom Background Add Inline Style Start wp_enqueue_style( 'befold-custom-style', get_template_directory_uri() . '/assets/plugins/css/custom-inline.css', array(), '1.0', true ); if( !defined( 'REDUX_PLUGIN_FILE' ) ) { $custom_css=""; $custom_css = '.page-header{background-image:url("'.get_header_image().'");background-size:cover;}'; // Banner on blog page css end wp_add_inline_style( 'befold-custom-style', $custom_css ); } } add_action( 'wp_enqueue_scripts', 'befold_scripts' ); function befold_admin_styles() { $add_theme_slug = 'befold_'; wp_enqueue_style( $add_theme_slug .'redux-custom', get_template_directory_uri() . '/assets/admin/css/redux-demo-style.css', false, '1.0.0' ); wp_enqueue_style( $add_theme_slug .'custom_block', get_template_directory_uri() . '/assets/admin/css/custom.css', false, '1.0.0' ); } add_action( 'admin_enqueue_scripts', 'befold_admin_styles' ); /** * Include the TGM_Plugin_Activation class. */ require_once get_template_directory() . '/inc/tgmpa/tgm-plugin-activation.php'; /** * Custom template tags for this theme. */ require_once get_template_directory() . '/inc/admin/options-init.php'; require get_template_directory() . '/inc/template-tags.php'; /** * Comments Callback. */ require_once get_template_directory() . '/inc/comments-callback.php'; /** * Add breadcrumb. */ require_once get_template_directory() . '/inc/breadcrumb.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Custom Funtion Files */ // Block Styles. //require get_template_directory() . '/inc/functions/block-patterns.php'; //require get_template_directory() . '/inc/functions/block-styles.php'; if ( ! function_exists( 'befold_post_navigation' ) ) : /** * Display navigation to next/previous post when applicable. */ function befold_post_navigation() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?>