= 2 || $page >= 2 ) { $title .= " {$sep} " . sprintf( __( 'Page %s', 'dbt' ), max( $paged, $page ) ); } return $title; } // end better title // remove WP version from RSS function simplyread_rss_version() { return ''; } // remove WP version from scripts function simplyread_remove_wp_ver_css_js( $src ) { if ( strpos( $src, 'ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; } // remove injected CSS for recent comments widget function simplyread_remove_wp_widget_recent_comments_style() { if ( has_filter( 'wp_head', 'wp_widget_recent_comments_style' ) ) { remove_filter( 'wp_head', 'wp_widget_recent_comments_style' ); } } // remove injected CSS from recent comments widget function simplyread_remove_recent_comments_style() { global $wp_widget_factory; if (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) { remove_action( 'wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style') ); } } // remove injected CSS from gallery function simplyread_gallery_style($css) { return preg_replace( "!!s", '', $css ); } /********************* SCRIPTS & ENQUEUEING *********************/ // loading modernizr and jquery, and reply script function simplyread_scripts_and_styles() { global $wp_styles; // call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way if (!is_admin()) { // modernizr (without media query polyfill) wp_register_script( 'simplyread-modernizr', get_stylesheet_directory_uri() . '/library/js/libs/modernizr.custom.min.js', array(), '2.5.3', false ); // register main stylesheet wp_register_style( 'simplyread-stylesheet', get_stylesheet_directory_uri() . '/library/css/style.css', array(), '', 'all' ); // ie-only style sheet wp_register_style( 'simplyread-ie-only', get_stylesheet_directory_uri() . '/library/css/ie.css', array(), '' ); wp_register_style( 'simplyread-font', get_stylesheet_directory_uri() . '/css/font-awesome.css', array(), '' ); // comment reply script for threaded comments if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { wp_enqueue_script( 'comment-reply' ); } //adding scripts file in the footer wp_register_script( 'simplyread-js', get_stylesheet_directory_uri() . '/library/js/scripts.js', array( 'jquery' ), '', true ); wp_register_script( 'simplyread-js-min', get_stylesheet_directory_uri() . '/js/jquery.min.js', array(), '', true ); wp_register_script( 'simplyread-js-ui', get_stylesheet_directory_uri() . '/js/jquery-ui.min.js', array(), '', true ); wp_register_script( 'simplyread-js-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', array(), '', true ); wp_register_script( 'simplyread-js-scripts-home', get_stylesheet_directory_uri() . '/js/scripts-home.js', array(), '', true ); wp_register_script( 'imagesloaded', get_template_directory_uri() . '/library/js/imagesloaded.pkgd.min.js', array(), '', true); wp_register_script( 'cycle2', get_template_directory_uri() . '/library/js/jquery.cycle2.min.js', array(), '', true ); wp_register_script( 'cycle2_tile', get_template_directory_uri() . '/library/js/jquery.cycle2.tile.min.js' , array(), '', true); wp_register_script( 'cycle2_shuffle', get_template_directory_uri() . '/library/js/jquery.cycle2.shuffle.min.js', array(), '', true ); wp_register_script( 'cycle2_scrollvert', get_template_directory_uri() . '/library/js/jquery.cycle2.scrollVert.min.js', array(), '', true ); wp_register_script( 'simplyread-js-masonry', get_stylesheet_directory_uri() . '/js/masonry.pkgd.min.js', array(), '', true ); // enqueue styles and scripts wp_enqueue_style( 'simplyread-font' ); wp_enqueue_script( 'simplyread-modernizr' ); wp_enqueue_style( 'simplyread-stylesheet' ); wp_enqueue_style( 'simplyread-ie' ); wp_enqueue_style( 'simplyread-ie-only' ); wp_enqueue_script( 'simplyread-js-min' ); wp_enqueue_script( 'simplyread-js-ui' ); wp_enqueue_script( 'simplyread-js-scripts' ); if ( is_home() ){ wp_enqueue_style( 'simplyread-stylesheet-slider' ); wp_enqueue_script( 'simplyread-js-slider' ); wp_enqueue_script( 'simplyread-js-masonry' ); wp_enqueue_script( 'simplyread-js-masonry' ); wp_enqueue_script( 'imagesloaded' ); wp_enqueue_script( 'cycle2' ); wp_enqueue_script( 'cycle2_tile' ); wp_enqueue_script( 'cycle2_shuffle' ); wp_enqueue_script( 'cycle2_scrollvert' ); wp_enqueue_script( 'simplyread-js-scripts-home' ); } $wp_styles->add_data( 'simplyread-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet /* I recommend using a plugin to call jQuery using the google cdn. That way it stays cached and your site will load faster. */ wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'simplyread-js' ); } } /********************* THEME SUPPORT *********************/ // Adding WP 3+ Functions & Theme Support function simplyread_theme_support() { // wp thumbnails (sizes handled in functions.php) add_theme_support( 'post-thumbnails' ); add_editor_style(); // default thumb size set_post_thumbnail_size(125, 125, true); // wp custom background (thx to @bransonwerner for update) add_theme_support( 'custom-background', array( 'default-image' => '', // background image default 'default-color' => 'ffffff', // background color default (dont add the #) 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ) ); // rss thingy add_theme_support('automatic-feed-links'); // to add header image support go here: http://themble.com/support/adding-header-background-image-support/ // adding post format support add_theme_support( 'post-formats', array( 'aside', // title less blurb 'gallery', // gallery of images 'link', // quick link to other site 'image', // an image 'quote', // a quick quote 'status', // a Facebook like status update 'video', // video 'audio', // audio 'chat' // chat transcript ) ); // wp menus add_theme_support( 'menus' ); // registering wp3+ menus register_nav_menus( array( 'main-nav' => __( 'The Main Menu', 'simplyreadtheme' ), // main nav in header /*'footer-links' => __( 'Footer Links', 'simplyreadtheme' ) // secondary nav in footer*/ ) ); } /* end simplyread theme support */ /********************* RELATED POSTS FUNCTION *********************/ // Related Posts Function (call using simplyread_related_posts(); ) function simplyread_related_posts() { echo '