comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    __( 'Search', 'vertigo' ), ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } $vertigo_options = vertigo_get_theme_options(); if ( 'true' == $vertigo_options['vertigo_font'] ) { wp_enqueue_script( 'cufon', get_template_directory_uri() . '/js/cufon-yui.js', array( 'jquery' ), '1.09i' ); wp_enqueue_script( 'hitchcock', get_template_directory_uri() . '/js/hitchcock_500.font.js' ); wp_enqueue_script( 'cufon_activate', get_template_directory_uri() . '/js/cufon-activate.js' ); } } add_action( 'wp_enqueue_scripts', 'vertigo_scripts' ); /** * Audio helper script. * * If an audio shortcode exists we will enqueue javascript * that replaces all non-supported audio player instances * with text links. * * @uses shortcode_exists(); */ function vertigo_audio_script() { if ( shortcode_exists( 'audio' ) ) return; if ( ! is_singular() || has_post_format( 'audio' ) ) wp_enqueue_script( 'vertigo-audio', get_template_directory_uri() . '/js/audio.js', array(), '20130521' ); } add_action( 'wp_enqueue_scripts', 'vertigo_audio_script' ); // Grab the first URL from a Link post function vertigo_url_grabber() { $first_url = ''; ob_start(); ob_end_clean(); $output = preg_match_all( '//i', get_the_content(), $matches ); $first_url = $matches[1][0]; if ( empty( $first_url ) ) $first_url = apply_filters( 'the_permalink', get_permalink() ); return $first_url; } // Grab the first image from an Image post function vertigo_image_grabber() { ob_start(); ob_end_clean(); $output = preg_match_all( '//i', get_the_content(), $matches ); return isset( $matches[0][0] ) ? $matches[0][0] : ''; } // Remove the first image the_content for display function vertigo_content_wo_first_image() { ob_start(); the_content(); $content_wo_first_image = preg_replace( '/]+./','', ob_get_contents(), 1 ); ob_end_clean(); return $content_wo_first_image; } // Grab the URL the first audio attachment in a post function vertigo_audio_grabber() { $first_audio = ''; if ( function_exists( 'get_attached_media' ) ) { $attached_media = get_attached_media( 'audio', get_the_ID() ); $first_audio = array_shift( $attached_media )->guid; } if ( empty( $first_audio ) ) { global $wpdb; $first_audio = $wpdb->get_results( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'attachment' AND post_mime_type = 'audio/mpeg' ORDER BY menu_order ASC LIMIT 1", get_the_ID() ) ); if ( $first_audio ) $first_audio = wp_get_attachment_url( $first_audio[0]->ID ); } return empty( $first_audio )? false : esc_url( $first_audio ); } /** * Get a short-form mime type for an audio file to display as a class attribute. * * @param int ID of an attachment * @return string A short representation of the file's mime type. */ function vertigo_post_classes( $classes ) { if ( has_post_format( 'audio' ) ) { $audio = vertigo_audio_grabber(); if ( is_object( $audio ) ) { $mime = str_replace( 'audio/', '', get_post_mime_type( $audio->ID ) ); if ( in_array( $mime, array( 'mp3', 'ogg', 'wav', ) ) ) $classes[] = $mime; } } return $classes; } add_filter( 'post_class', 'vertigo_post_classes' ); if ( ! function_exists( 'the_post_format_audio' ) ) : /** * Shiv for the_post_format_audio(). * * the_post_format_audio() was introduced to WordPress in version 3.6. To * provide backward compatibility with previous versions, we will define our * own version of this function. * * @todo Remove this function when WordPress 3.8 is released. * * @param string $name The name of the shortcode. * @return bool True if shortcode exists; False otherwise. */ function the_post_format_audio() { $audio = vertigo_audio_grabber(); if ( is_object( $audio ) ) : $url = wp_get_attachment_url( $audio->ID ); ?>
    ' . __( 'Read more.', 'vertigo' ) . ''; } add_filter( 'excerpt_more', 'vertigo_auto_excerpt_more' ); // Show post-meta for use in loop function vertigo_entry_meta() { ?>
    posted on
    by %6$s
    ', 'vertigo' ), get_permalink(), get_the_date( 'c' ), get_the_time( get_option( 'date_format' ) ), get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_attr( sprintf( __( 'View all posts by %s', 'vertigo' ), get_the_author() ) ), get_the_author() ); ?>
    __( 'Footer Area One', 'vertigo' ), 'id' => 'sidebar-1', 'description' => __( 'An optional widget area for your site footer', 'vertigo' ), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer Area Two', 'vertigo' ), 'id' => 'sidebar-2', 'description' => __( 'An optional widget area for your site footer', 'vertigo' ), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'vertigo_widgets_init' ); /** * Count the number of footer sidebars to enable dynamic classes for the footer */ function vertigo_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-1' ) ) $count++; if ( is_active_sidebar( 'sidebar-2' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; } if ( $class ) echo 'class="' . $class . '"'; } /** * Check number of pages available to display navigation */ function vertigo_pagination() { global $wp_query, $paged; $max_page = $wp_query->max_num_pages; if ( 1 == $max_page ) return; // don't show when only one page if ( empty( $paged ) ) $paged = 1; echo '

    ' . sprintf( __( 'Page %1$s of %2$s', 'vertigo' ), $paged, $max_page ) . '

    '; } /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Vertigo 1.1 */ function vertigo_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'vertigo' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'vertigo_wp_title', 10, 2 ); /** * Implement the Custom Header feature */ require( get_template_directory() . '/inc/custom-header.php' ); /** * This theme was built with PHP, Semantic HTML, CSS, love, and a Toolbox. */