__( 'Primary Menu', 'bloggable' ), ) ); add_theme_support('post-thumbnails'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // adding post format support add_theme_support( 'post-formats', array( 'aside', /* Typically styled without a title. Similar to a Facebook note update */ 'gallery', /* A gallery of images. Post will likely contain a gallery shortcode and will have image attachments */ 'link', /* A link to another site. Themes may wish to use the first tag in the post content as the external link for that post. An alternative approach could be if the post consists only of a URL, then that will be the URL and the title (post_title) will be the name attached to the anchor for it */ 'image', /* A single image. The first tag in the post could be considered the image. Alternatively, if the post consists only of a URL, that will be the image URL and the title of the post (post_title) will be the title attribute for the image */ 'quote', /* A quotation. Probably will contain a blockquote holding the quote content. Alternatively, the quote may be just the content, with the source/author being the title */ 'status', /*A short status update, similar to a Twitter status update */ 'video', /* A single video. The first
  • id="li-comment-">
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    Posted on by ', 'bloggable' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'bloggable' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Adds custom classes to the array of body classes. */ function bloggable_body_classes( $classes ) { // Adds a class of single-author to blogs with only 1 published author if ( ! is_multi_author() ) { $classes[] = 'single-author'; } return $classes; } add_filter( 'body_class', 'bloggable_body_classes' ); /** * Returns true if a blog has more than 1 category */ function bloggable_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'all_the_cool_cats', $all_the_cool_cats ); } if ( '1' != $all_the_cool_cats ) { // This blog has more than 1 category so bloggable_categorized_blog should return true return true; } else { // This blog has only 1 category so bloggable_categorized_blog should return false return false; } } /** * Flush out the transients used in bloggable_categorized_blog */ function bloggable_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'bloggable_category_transient_flusher' ); add_action( 'save_post', 'bloggable_category_transient_flusher' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages */ function bloggable_enhanced_image_navigation( $url ) { global $post, $wp_rewrite; $id = (int) $post->ID; $object = get_post( $id ); if ( wp_attachment_is_image( $post->ID ) && ( $wp_rewrite->using_permalinks() && ( $object->post_parent > 0 ) && ( $object->post_parent != $id ) ) ) $url = $url . '#main'; return $url; } add_filter( 'attachment_link', 'bloggable_enhanced_image_navigation' ); if ( ! function_exists( 'bloggable_pagination' ) ) : function bloggable_pagination($pages = '', $range = 4) { $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) { printf( __( '\n"; } } endif; function bloggable_w3c_valid_rel( $text ) { $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; } add_filter( 'the_category', 'bloggable_w3c_valid_rel' ); function bloggable_modernizr_addclass($output) { return $output . ' class="no-js"'; } add_filter('language_attributes', 'bloggable_modernizr_addclass'); function bloggable_modernizr_script() { wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/library/js/modernizr-2.6.2.min.js', false, '2.6.2'); } add_action('wp_enqueue_scripts', 'bloggable_modernizr_script'); function bloggable_custom_scripts() { wp_enqueue_script( 'bloggable_custom_js', get_template_directory_uri() . '/library/js/scripts.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'bloggable_style', get_stylesheet_uri() ); } add_action('wp_enqueue_scripts', 'bloggable_custom_scripts');