' . "\n\t\t\t";
hybrid_before_page_nav(); // Before navigation hook
$args = array(
'show_home' => __('Home', 'hybrid'),
'menu_class' => 'page-nav',
'sort_column' => 'menu_order',
'depth' => 4,
'echo' => 0
);
$nav = str_replace( array( "\r", "\n", "\t" ), '', wp_page_menu( $args ) );
$nav = str_replace( '
', $nav, 1 );
hybrid_after_page_nav(); // After navigation hook
echo "\n\t
\n";
}
/**
* Displays the default entry title. Wraps the title in the appropriate
* header tag. Use the hybrid_entry_title filter to customize.
*
* @since 0.5
*/
function hybrid_entry_title() {
if ( is_attachment() )
$title = the_title( '
', false );
elseif( is_front_page() && !is_home() )
$title = the_title( '
', false );
elseif ( is_page() )
$title = the_title( '
', false );
elseif ( is_single() )
$title = the_title( '
', false );
elseif ( 'link_category' == get_query_var( 'taxonomy' ) )
$title = false;
else
$title = the_title( '
', false );
echo apply_filters( 'hybrid_entry_title', $title );
}
/**
* Default entry byline for posts. Shows the author, date,
* and edit link. Use the hybrid_byline filter to customize.
*
* @since 0.5
*/
function hybrid_byline() {
global $post;
if ( !is_page() && !is_attachment() && 'link_category' !== get_query_var( 'taxonomy' ) ) :
$byline = '
';
$byline .= sprintf( __('By %1$s on %2$s', 'hybrid'), '' . get_the_author_meta( 'display_name' ) . '', '' . sprintf( get_the_time( get_option( 'date_format' ) ) ) . '' );
if ( current_user_can( 'edit_posts' ) )
$byline .= ' | ' . __('Edit', 'hybrid') . '';
$byline .= '
';
endif;
echo apply_filters( 'hybrid_byline', $byline );
}
/**
* Displays the default entry metadata. Shows the category, tag,
* and comments link. Use the hybrid_entry_meta filter to customize.
*
* @since 0.5
*/
function hybrid_entry_meta() {
global $post;
if ( !is_singular() && comments_open() ) :
$number = get_comments_number();
if ( $number == 0 )
$comments_link = ' ';
elseif ( $number == 1 )
$comments_link = ' ';
else
$comments_link = ' ';
endif;
if ( !is_page() && !is_attachment() && 'link_category' !== get_query_var( 'taxonomy' ) ) :
$metadata = '
';
$metadata .= get_the_term_list( $post->ID, 'category', '' . __('Posted in', 'hybrid') . ' ', ', ', '' );
$metadata .= get_the_term_list( $post->ID, 'post_tag', ' | ' . __('Tagged', 'hybrid') . ' ', ', ', '' );
$metadata .= $comments_link;
$metadata .= '
';
elseif ( is_page() ) :
if ( current_user_can( 'edit_pages' ) ) :
$metadata = '
';
$metadata .= '' . __('Edit', 'hybrid') . '';
$metadata .= '
';
endif;
endif;
echo apply_filters( 'hybrid_entry_meta', $metadata );
}
/**
* Displays the page's profile URI.
* @link http://microformats.org/wiki/profile-uris
*
* @since 0.6
*/
function hybrid_profile_uri() {
echo apply_filters( 'hybrid_profile_uri', 'http://gmpg.org/xfn/11' );
}
/**
* Overrides WP's default template for date-based archives.
* Better abstraction of templates than is_date() allows for using
* checks for the year, month, week, and day.
*
* @since 0.6
* @param string $template
* @return string $template Full path to file.
*/
function hybrid_date_template( $template ) {
if ( get_query_var( 'minute' ) )
return locate_template( array( 'minute.php' ) );
elseif ( get_query_var( 'hour' ) )
return locate_template( array( 'hour.php' ) );
elseif ( is_time() )
return locate_template( array( 'time.php' ) );
elseif ( is_day() )
return locate_template( array( 'day.php' ) );
elseif ( get_query_var( 'w' ) )
return locate_template( array( 'week.php' ) );
elseif ( is_month() )
return locate_template( array( 'month.php' ) );
elseif ( is_year() )
return locate_template( array( 'year.php' ) );
return $template;
}
/**
* Overrides WP's default template for author-based archives.
* Better abstraction of templates than is_author() allows by
* allowing themes to specify templates for a specific author.
*
* @since 0.6
* @param string $template
* @return string Full path to file.
*/
function hybrid_author_template( $template ) {
return locate_template( array( 'author-' . absint( get_query_var( 'author' ) ) . '.php', 'author.php' ) );
}
/**
* Filters main feed links for the site. This changes the feed links
* to the user's alternate feed URL. This change only happens if the
* user chooses it from the theme settings.
*
* @since 0.4
* @param string $output
* @param string $feed
* @return string $output
*/
function hybrid_feed_link( $output, $feed ) {
global $hybrid_settings;
if ( $hybrid_settings['feed_url'] ) :
$url = esc_url( $hybrid_settings['feed_url'] );
$outputarray = array( 'rss' => $url, 'rss2' => $url, 'atom' => $url, 'rdf' => $url, 'comments_rss2' => '' );
$outputarray[$feed] = $url;
$output = $outputarray[$feed];
endif;
return $output;
}
/**
* Filters the category, author, and tag feed links. This changes all
* of these feed links to the user's alternate feed URL. This change
* only happens if the user chooses it from the theme settings.
*
* @since 0.4
* @param string $link
* @return string $link
*/
function hybrid_other_feed_link( $link ) {
global $hybrid_settings;
if ( $hybrid_settings['feeds_redirect'] && $hybrid_settings['feed_url'] )
$link = esc_url( $hybrid_settings['feed_url'] );
return $link;
}
/**
* Displays the breadcrumb trail. Calls the get_the_breadcrumb() function.
* Use the get_the_breadcrumb_args filter hook. The hybrid_breadcrumb_args
* filter is deprecated.
*
* @deprecated 0.5 Theme still needs this function.
* @todo Find an elegant way to transition to breadcrumb_trail()
* in child themes and filter breadcrumb_trail_args instead.
*
* @since 0.1
*/
function hybrid_breadcrumb() {
$args = apply_filters( 'hybrid_breadcrumb_args', $args ); // Deprecated. Use breadcrumb_trail_args.
$args = wp_parse_args( $args, array( 'front_page' => false ) );
breadcrumb_trail( $args );
}
?>