__( 'Primary Menu', 'infosource' ), ) ); add_theme_support('post-thumbnails'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // custom backgrounds $infosource_custom_background = array( // Background color default 'default-color' => 'F4F0EF', // Background image default 'default-image' => get_template_directory_uri() . '/library/images/bg.jpg', 'wp-head-callback' => '_custom_background_cb' ); add_theme_support('custom-background', $infosource_custom_background ); // 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 ', 'infosource' ), 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', 'infosource' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Adds custom classes to the array of body classes. */ function infosource_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', 'infosource_body_classes' ); /** * Returns true if a blog has more than 1 category */ function infosource_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 infosource_categorized_blog should return true return true; } else { // This blog has only 1 category so infosource_categorized_blog should return false return false; } } /** * Flush out the transients used in infosource_categorized_blog */ function infosource_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'infosource_category_transient_flusher' ); add_action( 'save_post', 'infosource_category_transient_flusher' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages */ function infosource_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', 'infosource_enhanced_image_navigation' ); if ( ! function_exists( 'infosource_pagination' ) ) : function infosource_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 infosource_w3c_valid_rel( $text ) { $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; } add_filter( 'the_category', 'infosource_w3c_valid_rel' ); function infosource_modernizr_addclass($output) { return $output . ' class="no-js"'; } add_filter('language_attributes', 'infosource_modernizr_addclass'); function infosource_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', 'infosource_modernizr_script'); function infosource_custom_scripts() { wp_enqueue_script( 'infosource_custom_js', get_template_directory_uri() . '/library/js/scripts.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'infosource_style', get_stylesheet_uri() ); } add_action('wp_enqueue_scripts', 'infosource_custom_scripts'); ?>