'). "\n"; } /** * Sets the post excerpt length to 50 words. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. * * @since basically 2.1.0 */ function basically_excerpt_length( $length ) { return 50; } add_filter( 'excerpt_length', 'basically_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts * * @since basically 2.1.0 */ function basically_continue_reading_link() { return ' ' . __( 'Continue reading ', 'basically' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and basically_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. * * @since basically 2.1.0 */ function basically_auto_excerpt_more( $more ) { return ' …' . basically_continue_reading_link(); } add_filter( 'excerpt_more', 'basically_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. * * @since basically 2.1.0 */ function basically_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= basically_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'basically_custom_excerpt_more' ); /** * Remove gallery inline style * * @since basically 2.1.0 */ add_filter( 'gallery_style', 'basically_remove_gallery_css' ); function basically_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } /** * Stop more link from jumping to middle of page * * @since basically 2.1.0 */ add_filter('the_content_more_link', 'basically_remove_more_jump_link'); function basically_remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } /** * Adds custom classes to the array of body classes. * * @since basically 2.1.0 */ add_filter( 'body_class', 'basically_body_classes' ); function basically_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) { $classes[] = 'group-blog'; } return $classes; } /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages * * @since basically 2.1.0 */ add_filter( 'attachment_link', 'basically_enhanced_image_navigation', 10, 2 ); function basically_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; } /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. * * @since basically 2.1.0 */ add_filter( 'wp_page_menu_args', 'basically_page_menu_args' ); function basically_page_menu_args( $args ) { $args['show_home'] = true; return $args; } // end basically_page_menu_args() ?>