__( 'Top Navigation Menu', 'the-newswire' ), 'primary-nav' => __( 'Main Navigation Menu', 'the-newswire' ), ) ); 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 $newswire_custom_background = array( // Background color default 'default-color' => 'ffffff', // Background image default 'default-image' => '', 'wp-head-callback' => '_custom_background_cb' ); add_theme_support('custom-background', $newswire_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 ', 'the-newswire' ), 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', 'the-newswire' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Adds custom classes to the array of body classes. */ if ( ! function_exists( 'newswire_body_classes' ) ) : function newswire_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; } endif; add_filter( 'body_class', 'newswire_body_classes' ); /** * Returns true if a blog has more than 1 category */ if ( ! function_exists( 'newswire_categorized_blog' ) ) : function newswire_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 newswire_categorized_blog should return true return true; } else { // This blog has only 1 category so newswire_categorized_blog should return false return false; } } endif; /** * Flush out the transients used in newswire_categorized_blog */ if ( ! function_exists( 'newswire_category_transient_flusher' ) ) : function newswire_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } endif; add_action( 'edit_category', 'newswire_category_transient_flusher' ); add_action( 'save_post', 'newswire_category_transient_flusher' ); /** * Remove WP default gallery styling */ add_filter( 'use_default_gallery_style', '__return_false' ); /** * The Pagination Function */ if ( ! function_exists( 'newswire_pagination' ) ) : function newswire_pagination() { global $wp_query; $big = 999999999; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1){ $wp_query->query_vars['paged'] > 1 ? $current_page = $wp_query->query_vars['paged'] : $current_page = 1; echo ''; } } endif; /** * Add "Untitled" for posts without title, */ function newswire_post_title($title) { if ($title == '') { return __('Untitled', 'the-newswire'); } else { return $title; } } add_filter('the_title', 'newswire_post_title'); /** * Custom excerpt function */ if ( ! function_exists( 'newswire_excerpt' ) ) : function newswire_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; } endif; /** * Fix for W3C validation */ if ( ! function_exists( 'newswire_w3c_valid_rel' ) ) : function newswire_w3c_valid_rel( $text ) { $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; } endif; add_filter( 'the_category', 'newswire_w3c_valid_rel' ); /* * Modernizr functions */ if ( ! function_exists( 'newswire_modernizr_addclass' ) ) : function newswire_modernizr_addclass($output) { return $output . ' class="no-js"'; } endif; add_filter('language_attributes', 'newswire_modernizr_addclass'); if ( ! function_exists( 'newswire_modernizr_script' ) ) : function newswire_modernizr_script() { wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/library/js/modernizr-2.6.2.min.js', false, '2.6.2'); } endif; add_action('wp_enqueue_scripts', 'newswire_modernizr_script'); /** * Ignore Sticky */ function newswire_ignore_sticky($query) { if ( is_home() && $query->is_main_query() ) { $query->set( 'ignore_sticky_posts', true ); } return $query; } add_action('pre_get_posts', 'newswire_ignore_sticky'); /** * Enqueue scripts & styles */ if ( ! function_exists( 'newswire_custom_scripts' ) ) : function newswire_custom_scripts() { wp_register_script( 'imagesloaded', get_template_directory_uri() . '/library/js/imagesloaded.pkgd.min.js'); wp_register_script( 'cycle2', get_template_directory_uri() . '/library/js/jquery.cycle2.min.js' ); wp_register_script( 'cycle2_tile', get_template_directory_uri() . '/library/js/jquery.cycle2.tile.min.js' ); wp_register_script( 'cycle2_shuffle', get_template_directory_uri() . '/library/js/jquery.cycle2.shuffle.min.js' ); wp_register_script( 'cycle2_scrollvert', get_template_directory_uri() . '/library/js/jquery.cycle2.scrollVert.min.js' ); wp_enqueue_script( 'newswire_custom_js', get_template_directory_uri() . '/library/js/scripts.js', array( 'jquery', 'imagesloaded', 'cycle2', 'cycle2_tile', 'cycle2_shuffle', 'cycle2_scrollvert', 'jquery-masonry' ), '1.0.0' ); wp_enqueue_style( 'newswire_style', get_stylesheet_uri() ); } endif; add_action('wp_enqueue_scripts', 'newswire_custom_scripts'); ?>