for posts and comments. add_theme_support( 'automatic-feed-links' ); // Theme POST FORMATS add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'link', 'quote', 'status', 'video', 'audio', 'chat' ) ); register_nav_menus( array( 'main-menu' => __( 'Main Menu', 'bitter-sweet' ), ) ); // add Theme Post Thumbnail Support add_theme_support( 'post-thumbnails' ); add_image_size( 'recent-posts', 70, 70, true ); add_image_size( 'featured-post', 330, 200, true ); } add_action( 'after_setup_theme', 'bittersweet_theme_setup' ); /*-----------------------------------------------------------------------------------*/ /* Register theme scripts & styles */ /*-----------------------------------------------------------------------------------*/ add_action('wp_enqueue_scripts', 'bittersweet_scripts_styles'); function bittersweet_scripts_styles() { // enqueue theme styles wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', 'style'); wp_enqueue_style('shareicons', get_template_directory_uri() . '/css/shareicons.css', 'style'); wp_enqueue_style('style', get_template_directory_uri() . '/style.css'); // enqueue theme scripts wp_enqueue_script( 'slides', SCRIPTS . '/jquery.slides.min.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'bootstrap', SCRIPTS . '/bootstrap.min.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'classie', SCRIPTS . '/classie.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'uisearch', SCRIPTS . '/uisearch.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'easing', SCRIPTS . '/easing.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'ui-to-top', SCRIPTS . '/jquery.ui.totop.min.js', array( 'jquery' ), false, true ); wp_register_script( 'html5shiv', SCRIPTS . '/html5shiv.js', array( 'jquery' ), false, true ); wp_register_script( 'respond', SCRIPTS . '/respond.min.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'component', get_template_directory_uri() . '/js/component.js',array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'bitter-sweet-modernizr', get_template_directory_uri() . '/js/modernizr.custom.js',array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'bitter-sweet-functions', get_template_directory_uri() . '/js/custom-functions.js',array( 'jquery' ), '1.0', true ); global $is_IE; if ( $is_IE ) { wp_enqueue_script('html5shiv', get_template_directory_uri() . '/js/html5shiv.js', 'jquery'); wp_enqueue_script('respond', get_template_directory_uri() . '/js/respond.min.js', 'jquery'); } // load comment-reply on single if ( is_singular() ) wp_enqueue_script('comment-reply'); } // Filtering wp_title add_filter( 'wp_title', 'bittersweet_wp_title_filter' ); function bittersweet_wp_title_filter( $title ) { global $page, $paged; if ( is_feed() ) return $title; $site_description = get_bloginfo( 'description' ); $filtered_title = $title . get_bloginfo( 'name' ); $filtered_title .= ( ! empty( $site_description ) && ( is_home() || is_front_page() ) ) ? ' | ' . $site_description: ''; $filtered_title .= ( 2 <= $paged || 2 <= $page ) ? ' | ' . sprintf( __( 'Page %s', 'bitter-sweet' ), max( $paged, $page ) ) : ''; // show filtered title return $filtered_title; } if ( ! function_exists( 'bittersweet_content_nav' ) ) : // function for content nav below posts function bittersweet_content_nav( $class ) { global $wp_query; $class = esc_attr( $class ); if ( $wp_query->max_num_pages > 1 ) : ?> ID ) ? rand() : $post->ID ); $password_form = '
'.__('

This post is password protected. To view it please enter your password below:

', 'bitter-sweet').'
'; return $password_form; } /** * bittersweet paginated links */ function bittersweet_pagination() { global $wp_query; $big = 999999999; // need an unlikely integer $pages = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'mid_size' => 2, 'type' => 'array', 'prev_next' => true, 'prev_text' => '', 'next_text' => '', ) ); if( is_array( $pages ) ) { $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo '
'; } } // comment after text add_filter( 'comment_form_defaults', 'bittersweet_filter_allowed_tags' ); function bittersweet_filter_allowed_tags( $defaults ) { $defaults['comment_notes_after'] = '

' . sprintf( __( 'You may use these HTML tags and attributes: %s' ), ' ' . allowed_tags() . '' ) . '

'; return $defaults; } // COMMENTS AND PINGBACKS if ( ! function_exists( 'bittersweet_comment' ) ) : function bittersweet_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
  • >
    says:', 'bitter-sweet' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved ) : ?>

    'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
    ', 'after' => '
    ', ) ) ); ?> ', '' ); ?>