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 navigation - menus add_action( 'init', 'oopthemes_register_menus' ); function oopthemes_register_menus() { register_nav_menus( array( 'main-menu' => __( 'Main Menu', 'BitterSweet' ), ) ); } // 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', 'oopthemes_theme_setup' ); // Load Theme scripts & Styles add_action( 'wp_enqueue_scripts', 'oopthemes_scripts_styles' ); function oopthemes_scripts_styles() { // add javascript to threated comments if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // JQuery-js script file wp_enqueue_script( 'jquery' ); // bootstrap-js script file wp_enqueue_script( 'Bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array(), '3.0', true); wp_enqueue_script( 'classie', get_template_directory_uri() . '/js/classie.js', true ); wp_enqueue_script( 'uisearch', get_template_directory_uri() . '/js/uisearch.js', true ); wp_enqueue_script( 'component', get_template_directory_uri() . '/js/component.js', array(), '1.0', true ); wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/modernizr.custom.js', array(), '1.0', true ); // Bootstrap wp_enqueue_style( '', get_template_directory_uri() . '/css/bootstrap.min.css' ); // share icons wp_enqueue_style( 'share-icons', get_template_directory_uri() . '/css/shareicons.css' ); // Loads theme stylesheet. wp_enqueue_style( 'style', get_stylesheet_uri() ); } // Filtering wp_title add_filter( 'wp_title', 'oopthemes_wp_title_filter' ); function oopthemes_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', 'BitterSweet' ), max( $paged, $page ) ) : ''; // show filtered title return $filtered_title; } if ( ! function_exists( 'oopthemes_content_nav' ) ) : // function for content nav below posts function oopthemes_content_nav( $class ) { global $wp_query; $class = esc_attr( $class ); if ( $wp_query->max_num_pages > 1 ) : ?> __( 'Main Sidebar', 'BitterSweet' ), 'id' => 'sidebar-main', 'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'BitterSweet' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'oopthemes_register_sidebar' ); // Password Form. add_filter( 'the_password_form', 'oopthemes_password_form' ); function oopthemes_password_form() { global $post; $label = 'password-'.( empty( $post->ID ) ? rand() : $post->ID ); $password_form = '
'.__('

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

', 'BitterSweet').'
'; return $password_form; } // PAGINATION FOR BLOG AND OTHER PAGES function oopthemes_pagination_nav($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "
"; } } // comment after text add_filter( 'comment_form_defaults', 'oopthemes_filter_allowed_tags' ); function oopthemes_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( 'oopthemes_comment' ) ) : function oopthemes_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
  • >
    says:', 'BitterSweet' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved ) : ?>

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