__( 'Header Menu (no drop-downs)', 'mystem' ),
'primary' => __( 'Primary Menu', 'mystem' ),
'mobileleft' => __( 'Mobile Left Menu', 'mystem' ),
'mobileright' => __( 'Mobile Right Menu', 'mystem' ),
) );
// Enable support for HTML5 markup.
add_theme_support( 'html5', array(
'comment-list',
'search-form',
'comment-form',
) );
}
endif; // stem_setup
add_action( 'after_setup_theme', 'mystem_setup' );
function mystem_add_menu_page() {
add_theme_page( __('About MyStem', 'mystem' ), __('About MyStem', 'mystem' ), 'edit_theme_options', 'mystem', 'mystem_options_page' );
}
add_action( 'admin_menu', 'mystem_add_menu_page' );
if ( ! function_exists( 'mystem_options_page' ) ) {
function mystem_options_page() {
load_template( dirname( __FILE__ ) . '/admin/index.php' );
}
}
/**
* Register widgetized area and update sidebar with default widgets.
*/
function mystem_widgets_init() {
register_sidebar( array(
'name' => __( 'Primary Sidebar', 'mystem' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'mystem' ),
'id' => 'footer-sidebar-1',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'mystem' ),
'id' => 'footer-sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'mystem' ),
'id' => 'footer-sidebar-3',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'mystem_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function mystem_scripts() {
// main stylesheet
wp_enqueue_style( 'mystem-style', get_stylesheet_uri() );
wp_add_inline_style( 'mystem-style', mystem_color_scheme_css() );
// font awesome stylesheet
wp_enqueue_style( 'mystem-font-awesome', get_template_directory_uri() . '/font-awesome/css/fontawesome-all.min.css', array(), '5.0.11', 'all' );
// Google fonts - Pacifico & Quicksand
wp_enqueue_style( 'mystem-googlefonts', '//fonts.googleapis.com/css?family=Pacifico|Quicksand:400italic,700italic,400,700' );
// theme assets
wp_enqueue_script( 'mystem-navigation', get_template_directory_uri() . '/inc/assets/js/navigation.js', array('jquery'), null, true );
wp_enqueue_script( 'mystem-skip-link-focus-fix', get_template_directory_uri() . '/inc/assets/js/skip-link-focus-fix.js' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'mystem_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';
/** ===============
* Adjust excerpt length
*/
if ( ! function_exists( 'mystem_custom_excerpt_length' ) ) {
function mystem_custom_excerpt_length( $length ) {
if ( !is_admin() ){
return 35;
}
}
}
add_filter( 'excerpt_length', 'mystem_custom_excerpt_length', 999 );
/** ===============
* Replace excerpt ellipses with new ellipses and link to full article
*/
if ( ! function_exists( 'mystem_excerpt_more' ) ) {
function mystem_excerpt_more( $more ) {
if ( !is_admin() ) {
return '... ';
}
}
}
add_filter( 'excerpt_more', 'mystem_excerpt_more' );
/** ===============
* Add .top class to the first post in a loop
*/
if ( ! function_exists( 'mystem_first_post_class' ) ) {
function mystem_first_post_class( $classes ) {
global $wp_query;
if ( 0 == $wp_query->current_post ) {
$classes[] = 'top';
}
return $classes;
}
}
add_filter( 'post_class', 'mystem_first_post_class' );
/**
* Change the Tag Cloud's Font Sizes.
*
* @since 1.0.
*
* @param array $args
*
* @return array
*/
if ( ! function_exists( 'mystem_change_tag_cloud_font_sizes' ) ) {
function mystem_change_tag_cloud_font_sizes( array $args ) {
$args['smallest'] = '8';
$args['largest'] = '8';
return $args;
}
}
add_filter( 'widget_tag_cloud_args', 'mystem_change_tag_cloud_font_sizes' );