Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** This action will run the function below after the theme has been setup */
- add_action( 'after_setup_theme', 'child_theme_setup' );
- /** This function will hold our new calls and over-rides */
- if ( !function_exists( 'child_theme_setup' ) ):
- function child_theme_setup() {
- /**
- *Change the "Continue Reading" link to post excerpts.
- * Returns a "Read More" link for excerpts
- */
- function child_continue_reading_link() {
- return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Read More <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>';
- }
- /** remove the existing filters */
- remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
- remove_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
- /** Add the new filters */
- function child_auto_excerpt_more( $more ) {
- return '<br/> …' . child_continue_reading_link();
- }
- add_filter( 'excerpt_more', 'child_auto_excerpt_more' );
- function child_custom_excerpt_more( $output ) {
- if ( has_excerpt() && ! is_attachment() ) {
- $output .= child_continue_reading_link();
- }
- return $output;
- }
- add_filter( 'get_the_excerpt', 'child_custom_excerpt_more' );
- }
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement