' . __( 'Continue reading
', 'widely' ) . ''; } endif; // widely_continue_reading_link /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and widely_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function widely_auto_excerpt_more( $more ) { return ' …' . widely_continue_reading_link(); } add_filter( 'excerpt_more', 'widely_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function widely_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= widely_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'widely_custom_excerpt_more' ); /** * Adds custom classes to the array of body classes. * * @param array $classes * @return array * * @since Widely 1.0 */ function widely_body_classes( $classes ) { $count = 0; if ( is_active_sidebar( 'sidebar-1' ) ) $count++; if ( is_active_sidebar( 'sidebar-2' ) ) $count++; if ( is_active_sidebar( 'sidebar-3' ) ) $count++; if ( is_active_sidebar( 'sidebar-4' ) ) $count++; $sidebar_classes = array( 'sidebars-none', 'sidebars-one', 'sidebars-two', 'sidebars-three', 'sidebars-four', ); $classes[] = $sidebar_classes[ $count ]; // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) { $classes[] = 'group-blog'; } return $classes; } add_filter( 'body_class', 'widely_body_classes' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages * * @param string $url * @param int $id * @return string * * @since Widely 1.0 */ function widely_enhanced_image_navigation( $url, $id ) { if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) return $url; $image = get_post( $id ); if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) $url .= '#main'; return $url; } add_filter( 'attachment_link', 'widely_enhanced_image_navigation', 10, 2 ); /** * Filters wp_title to print a neat