'fff' ) ); function add_nofollow_cat( $text ) { $text = str_replace('rel="category"', '', $text); $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; } add_filter( 'the_category', 'add_nofollow_cat' ); add_editor_style('/inc/custom-editor-style.css'); function new_excerpt_more($more) { global $post; return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function blank_slate_title($title) { if ($title == '') { return 'Untitled Post'; } else { return $title; } } add_filter('short_title', 'home_short_title'); /* Thanks to One Trick Pony, StackExchange */ add_filter('post_class', 'my_post_class'); function my_post_class($classes){ global $wp_query; if(($wp_query->current_post+1) == $wp_query->post_count) $classes[] = 'last'; return $classes; } /* Secondary Excerpt by c.bavota - thanks! */ function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt; } function content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).'...'; } else { $content = implode(" ",$content); } $content = preg_replace('/\[.+\]/','', $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content; } } function bartleby_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'bartleby' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'bartleby_wp_title', 10, 2 ); add_action( 'after_setup_theme', 'bartleby_theme_setup' ); /* Scripts, Fonts & Styles */ /** * Enqueue Google Fonts */ function bartleby_font() { $protocol = is_ssl() ? 'https' : 'http'; wp_register_style( 'bartleby-slab', "$protocol://fonts.googleapis.com/css?family=Josefin+Slab" ); wp_register_style( 'bartleby-ubuntu', "$protocol://fonts.googleapis.com/css?family=Ubuntu+Condensed" ); } add_action( 'init', 'bartleby_font' ); function bartleby_scripts_styles() { global $wp_styles; wp_register_style( 'bartleby-foundation-style', get_template_directory_uri() . '/stylesheets/foundation.min.css', array(), '2132013', 'all' ); // enqueing: wp_enqueue_style( 'bartleby-foundation-style' ); wp_enqueue_style( 'style', get_stylesheet_uri() ); wp_enqueue_style( 'bartleby-slab' ); wp_enqueue_style( 'bartleby-ubuntu' ); wp_enqueue_script( 'bartleby-navigation', get_template_directory_uri() . '/javascripts/navigation.js', array(), '1.0', true ); wp_enqueue_script( 'foundation-modernizr', get_template_directory_uri() . '/javascripts/modernizr.foundation.js', array(), '1.0', true ); } add_action( 'wp_enqueue_scripts', 'bartleby_scripts_styles' ); function bartleby_sidebars() { register_sidebar(array( 'name' => __( 'Right Sidebar', 'bartleby' ), 'id' => 'sidebar', 'description' => __( 'Widgets in this area will be shown on the right-hand side.', 'bartleby' ), 'before_widget' => '
', '' ); ?>