',
) );
register_sidebar(array(
'name' => 'Call to Action',
'id' => 'pitch-content',
'description' => 'Under content, over middle - Best used for call to action..',
'before_widget' => '
'
));
register_sidebar(array(
'name' => 'Footer Content',
'id' => 'footer-content',
'description' => 'Footer text or acknowledgements',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
'
));
}
add_action( 'init', 'avedon_widgets_init' );
/* Continue Link */
function avedon_excerpt($more) {
global $post;
return '... Continue Reading';
}
add_filter('excerpt_more', 'avedon_excerpt');
if ( ! function_exists( 'avedon_posted_on' ) ) :
/* Print Meta */
function avedon_posted_on() {
printf( __( 'Posted on by %7$s', 'avedon' ),
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', 'avedon' ), get_the_author() ) ),
esc_html( get_the_author() )
);
}
endif;
/* 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() {
$delimiter = '
/
';
$home = 'Home'; // 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 '