Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Custom Excerpt length
- remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
- function finest_excerpt_length( $length ) {
- return 20;
- }
- add_filter( 'excerpt_length', 'finest_excerpt_length', 999 );
- /**
- * Returns a "Continue Reading" link for excerpts
- *
- * @since Twenty Ten 1.0
- * @return string "Continue Reading" link
- */
- function twentyten_continue_reading_link() {
- return ' <a href="'. get_permalink() . '">' . __( 'Continue reading', 'twentyten' ) . '</a>';
- }
- /**
- * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_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 Twenty Ten 1.0
- * @return string An ellipsis
- */
- function twentyten_auto_excerpt_more( $more ) {
- return ' …' . twentyten_continue_reading_link();
- }
- add_filter( 'excerpt_more', 'twentyten_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 Twenty Ten 1.0
- * @return string Excerpt with a pretty "Continue Reading" link
- */
- function twentyten_custom_excerpt_more( $output ) {
- if ( has_excerpt() && ! is_attachment() ) {
- $output .= twentyten_continue_reading_link();
- }
- return $output;
- }
- add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement