'323232', 'default-image' => get_template_directory_uri() . '/assets/images/bg.png', ) ) ); /** * Enable support for Post Thumbnails on posts and pages. */ add_theme_support( 'post-thumbnails' ); /** * Enable title-tag support */ add_theme_support( "title-tag" ); /** * Custom Header theme support */ add_theme_support( 'custom-header' ); // add a hard cropped (for uniformity) image size for the product grid add_image_size( 'brevitas_featured_image', 738, 200, true ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'header' => __( 'Header Menu', 'brevitas' ), ) ); // Enable support for HTML5 markup. add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', 'gallery', 'caption' ) ); } endif; // brevitas_setup add_action( 'after_setup_theme', 'brevitas_setup' ); /** * Register Admin Editor Styles * * @link https://codex.wordpress.org/Function_Reference/add_editor_style */ function brevitas_add_editor_styles() { add_editor_style( 'brevitas-editor-style.css' ); } add_action( 'admin_init', 'brevitas_add_editor_styles' ); /** * Register widget area. * * @link http://codex.wordpress.org/Function_Reference/register_sidebar */ function brevitas_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'brevitas' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '', 'before_title' => '', ) ); } add_action( 'widgets_init', 'brevitas_widgets_init' ); /** * Enqueue scripts and styles. */ function brevitas_scripts() { wp_enqueue_script( 'brevitas-pace-loader', get_template_directory_uri() . '/assets/js/pace.min.js', array(), BREVITAS_VERSION, false ); // main stylesheet wp_enqueue_style( 'brevitas-style', get_stylesheet_uri() ); // Roboto Slab from Google fonts wp_enqueue_style( 'brevitas-google-fonts-roboto-slab', '//fonts.googleapis.com/css?family=Roboto+Slab:400,700' ); // Font Awesome wp_enqueue_style( 'brevitas-font-awesome', get_template_directory_uri() . '/assets/fonts/font-awesome/css/font-awesome.min.css' ); // responsive navigation script wp_enqueue_script( 'brevitas-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), BREVITAS_VERSION, true ); // skip link script wp_enqueue_script( 'brevitas-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), BREVITAS_VERSION, true ); // comments reply support if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) : wp_enqueue_script( 'comment-reply' ); endif; } add_action( 'wp_enqueue_scripts', 'brevitas_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'; /** * Replace excerpt ellipses with new ellipses and link to full article */ function brevitas_excerpt_more( $more ) { return '...
' . get_theme_mod( 'brevitas_read_more', __( 'Continue reading', 'brevitas' ) ) . '
'; } add_filter( 'excerpt_more', 'brevitas_excerpt_more' ); /** * Only show regular posts in search results. Also account for the bbPress search form. */ function brevitas_search_filter( $query ) { if ( $query->is_search && ! is_admin() && ( class_exists( 'bbPress' ) && ! is_bbpress() ) ) $query->set( 'post_type', 'post' ); return $query; } add_filter( 'pre_get_posts','brevitas_search_filter' ); /** * stupid skip link thing with the more tag -- remove it -- NOW */ function brevitas_remove_more_tag_link_jump( $link ) { $offset = strpos( $link, '#more-' ); if ( $offset ) : $end = strpos( $link, '"', $offset ); endif; if ( $end ) : $link = substr_replace( $link, '', $offset, $end-$offset ); endif; return $link; } add_filter( 'the_content_more_link', 'brevitas_remove_more_tag_link_jump' );