__( 'Primary Menu', 'aster' ) ) ); // Switch default core markup for search form, comment form, and comments to output valid HTML5. add_theme_support( 'html5', array( 'gallery', 'caption', ) ); // Custom Logo add_theme_support( 'custom-logo' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'aster_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); add_theme_support( 'woocommerce' ); // Post thumbnails add_theme_support( 'post-thumbnails' ); add_image_size( 'aster-post-thumbnails', 750, 450, true ); add_image_size( 'aster-recent-post', 110, 80, true ); } endif; // aster_theme_setup add_action( 'after_setup_theme', 'aster_theme_setup' ); ////////////////////////////////////////////////////////////////// // Register widget ////////////////////////////////////////////////////////////////// function aster_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'aster' ), 'id' => 'blog-sidebar', 'description' => esc_html__('Add widgets here to appear in your sidebar.', 'aster'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'aster_widgets_init' ); ////////////////////////////////////////////////////////////////// // Aster Fonts URL. ////////////////////////////////////////////////////////////////// function aster_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'aster' ) ) { $fonts[] = 'Open Sans:400,300,300italic,400italic,600,600italic,700,700italic'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } ////////////////////////////////////////////////////////////////// // Enqueue scripts and styles. ////////////////////////////////////////////////////////////////// function aster_all_scripts_and_css() { // CSS File wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), '3.3.6', 'all' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), '4.4.0', 'all' ); wp_enqueue_style( 'slicknav', get_template_directory_uri() . '/assets/css/slicknav.css', array(), null ); wp_enqueue_style( 'aster-stylesheet', get_stylesheet_uri() ); wp_enqueue_style( 'aster-responsive', get_template_directory_uri() . '/assets/css/responsive.css', array(), null ); // Google Fonts wp_enqueue_style( 'aster-google-fonts', aster_fonts_url(), array(), null ); // JS Files wp_enqueue_script( 'jquery-bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ), '3.3.6', true ); wp_enqueue_script( 'jquery-smoothscroll', get_template_directory_uri() . '/assets/js/smoothscroll.js', array( 'jquery' ), '0.9.9', true ); wp_enqueue_script( 'jquery-slicknav', get_template_directory_uri() . '/assets/js/jquery.slicknav.js', array( 'jquery' ), null, true ); wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true ); wp_enqueue_script( 'jquery-masonry', array( 'jquery' ), null, true); wp_enqueue_script( 'aster-scripts', get_template_directory_uri() . '/assets/js/scripts.js', array( 'jquery' ), null, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'aster_all_scripts_and_css' ); ////////////////////////////////////////////////////////////////// // Widget categories post counter ////////////////////////////////////////////////////////////////// function aster_categories_post_count_filter( $cat_post_count ) { $cat_post_count = str_replace( '(', ' (', $cat_post_count ); $cat_post_count = str_replace( ')', ' )', $cat_post_count ); return $cat_post_count; } add_filter( 'wp_list_categories', 'aster_categories_post_count_filter' ); ////////////////////////////////////////////////////////////////// // THE EXCERPT ////////////////////////////////////////////////////////////////// function aster_custom_excerpt_length( $length ) { return 46; } add_filter( 'excerpt_length', 'aster_custom_excerpt_length', 999 ); function aster_new_excerpt_more( $more ) { return '…'; } add_filter( 'excerpt_more', 'aster_new_excerpt_more' ); ////////////////////////////////////////////////////////////////// // COMMENTS LAYOUT ////////////////////////////////////////////////////////////////// if ( ! function_exists( 'aster_comment' ) ): function aster_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s', get_comment_author_link() ); ?>
    comment_approved ) : ?>

    ', '' ); ?> __( 'Reply', 'aster' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>