',
) );
register_sidebar(array(
'name' => __('Call to Action', 'avedon'),
'id' => 'pitch-content',
'description' => __('Under content, over middle - Best used for call to action.', 'avedon'),
'before_widget' => '
'
));
}
add_action( 'widgets_init', 'avedon_widgets_init' );
if ( ! function_exists( 'avedon_content_nav' ) ) :
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Twenty Twelve 1.0
*/
function avedon_content_nav( $html_id ) {
global $wp_query;
$html_id = esc_attr( $html_id );
if ( $wp_query->max_num_pages > 1 ) : ?>
ID) . '" class="btn btn-default btn-sm pull-right">'. __( 'Continue Reading', 'avedon' ) . '';
}
add_filter('excerpt_more', 'avedon_excerpt');
/* Body Classes */
function avedon_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', 'avedon_body_classes' );
/* Multi Category - via http://bootstrapwp.rachelbaker.me */
function avedon_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 bootstrap_categorized_blog should return true
return true;
} else {
// This blog has only 1 category so bootstrap_categorized_blog should return false
return false;
}
}
/* Flush Transients - via http://bootstrapwp.rachelbaker.me */
function avedon_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'all_the_cool_cats' );
}
add_action( 'edit_category', 'avedon_category_transient_flusher' );
add_action( 'save_post', 'avedon_category_transient_flusher' );
function avedon_enhanced_image_navigation( $url ) {
global $post;
if ( wp_attachment_is_image( $post->ID ) )
$url = $url . '#main';
return $url;
}
add_filter( 'attachment_link', 'avedon_enhanced_image_navigation' );
/* Check for Post Thumb */
function avedon_post_thumbnail_check() {
global $post;
if (get_the_post_thumbnail()) {
return true; }
else { return false; }
}
/* Add Breadcrumbs */
function avedon_breadcrumbs() {
$home = __( 'Home', 'avedon' ); // text for the 'Home' link
$before = '
'; // tag before the current crumb
$after = '
'; // tag after the current crumb
if ( !is_home() && !is_front_page() || is_paged() ) {
echo '