Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- 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() {
- /**
- * Returns a "Read More" link for excerpts
- */
- function info_continue_reading_link() {
- return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Read More <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>';
- }
- /**
- * Change the "Continue Reading" link to custom post excerpts.
- * remove the existeing filter and add our own
- */
- remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
- remove_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
- function info_auto_excerpt_more( $more ) {
- return '<br/> …' . info_continue_reading_link();
- }
- add_filter( 'excerpt_more', 'info_auto_excerpt_more' );
- function info_custom_excerpt_more( $output ) {
- if ( has_excerpt() && ! is_attachment() ) {
- $output .= info_continue_reading_link();
- }
- return $output;
- }
- add_filter( 'get_the_excerpt', 'info_custom_excerpt_more' );
- }
- endif;
- if (!function_exists( 'twentyeleven_posted_on' ) ) :
- /**
- * Create our own twentyeleven_posted_on to override parent function in our child theme
- */
- function twentyeleven_posted_on() {
- printf( __('<span class="by-author"> <span class="sep">Posted by </span> <span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span></span>', 'twentyeleven' ),
- esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
- esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
- get_the_author()
- );
- }
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement