Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'after_setup_theme', 'twentyeleven_child_continue_reading_setup' );
- function twentyeleven_child_continue_reading_setup() {
- remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
- add_filter( 'get_the_excerpt', 'twentyeleven_child_custom_excerpt_more' );
- remove_filter( 'excerpt_more', 'twentyeleven_child_auto_excerpt_more' );
- add_filter( 'excerpt_more', 'twentyeleven_child_auto_excerpt_more' );
- }
- function twentyeleven_child_custom_excerpt_more($output ) {
- if ( is_search() && has_excerpt() && ! is_attachment() ) {
- //edited 'continue reading' for search results//
- $output .= ' <a href="'. esc_url( get_permalink() ) . '">' . 'Search Results Continue Reading <span class="meta-nav">→</span>' . '</a>';
- } elseif ( has_excerpt() && ! is_attachment() ) {
- $output .= ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>';
- }
- return $output;
- }
- function twentyeleven_child_auto_excerpt_more($output ) {
- //edited 'continue reading' for search results//
- if( is_search() ) { return ' …' . ' <a href="'. esc_url( get_permalink() ) . '">' . 'Search Results Continue Reading <span class="meta-nav">→</span>' . '</a>';
- } else { return ' …' . twentyeleven_continue_reading_link();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement