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. add_theme_support( 'post-thumbnails' ); // Set the default content width. $GLOBALS['content_width'] = 688; // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'top' => esc_html__( 'Top Menu', 'bs4' ), 'top_secondary' => esc_html__( 'Top Secondary Menu', 'bs4' ), 'footer' => esc_html__( 'Footer Menu', 'bs4' ), ) ); // Switch default core markup for search form, comment form, and comments // to output valid HTML5. add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio', ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo' ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); } add_action( 'after_setup_theme', 'bs4_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 bs4_content_width() { $content_width = 688; if ( 'no-sidebar-page' === bs4_get_page_template_slug() ) { $content_width = 1110; } $GLOBALS['content_width'] = apply_filters( 'bs4_content_width', $content_width ); } add_action( 'template_redirect', 'bs4_content_width', 0 ); /** * Register WordPress widgets. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function bs4_widgets_init() { // Sidebar widget area arguments. $sidebar_args = array( 'name' => __( 'Sidebar', 'bs4' ), 'id' => 'secondary', 'description' => __( 'Add widgets here to appear in your sidebar.', 'bs4' ), 'before_widget' => '', 'before_title' => '
' . $link . '
'; } add_filter( 'the_content_more_link', 'bs4_the_content_more_link' ); /** * Enqueue scripts and styles. * * @link https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts */ function bs4_scripts() { // FontAwesome stylesheet. wp_enqueue_style( 'font-awesome', get_theme_file_uri( '/vendors/font-awesome/css/font-awesome.min.css' ) ); // Bootstrap 4 stylesheet that's filterable. wp_enqueue_style( 'bootstrap-4', get_theme_file_uri( '/vendors/bootstrap/css/bootstrap.min.css' ) ); // Theme custom stylesheet. wp_enqueue_style( 'parent', get_stylesheet_uri() ); // Inline layout styles. wp_add_inline_style( 'parent', bs4_layout_inline_styles() ); // Popper for Bootstrap 4 popovers and tooltips script. wp_enqueue_script( 'popper', get_theme_file_uri( '/vendors/popper/popper.js' ), array( 'jquery' ), false, true ); // Bootstrap 4 script. wp_enqueue_script( 'bootstrap-4', get_theme_file_uri( '/vendors/bootstrap/js/bootstrap.min.js' ), array( 'jquery' ), false, true ); // Comment, threaded comments, and replies script. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'bs4_scripts' ); /* * Custom plugins for this theme if activated */ require get_parent_theme_file_path( '/inc/plugins/plugins.php' ); /* * Custom walker for WordPress nav menu */ require get_parent_theme_file_path( '/inc/class-bs4-walker-nav-menu.php' ); /* * Custom walker for WordPress child page list */ require get_parent_theme_file_path( '/inc/class-bs4-walker-page.php' ); /* * Custom walker for WordPress blog comments and replies */ require get_parent_theme_file_path( '/inc/class-bs4-walker-comments.php' ); /* * Custom template tags for this theme */ require get_parent_theme_file_path( '/inc/template-tags.php' ); /* * Theme conditional CSS styles */ require get_parent_theme_file_path( '/inc/template-styles.php' ); /* * Bootstrap helpers */ require get_parent_theme_file_path( '/inc/template-bootstrap-functions.php' ); /* * Additional features to allow styling of the templates */ require get_parent_theme_file_path( '/inc/template-functions.php' ); /* * Customizer additions */ require get_parent_theme_file_path( '/inc/customizer.php' );