Why can't I override WP's 'excerpt_more' filter via my child theme functions?
Posted
by
Osu
on Stack Overflow
See other posts from Stack Overflow
or by Osu
Published on 2012-04-09T23:25:16Z
Indexed on
2012/04/09
23:29 UTC
Read the original article
Hit count: 268
I can't seem to get my functions to work for changing the excerpt_more
filter of the Twenty Eleven parent theme.
I suspect it might actually be add_action( 'after_setup_theme', 'twentyeleven_setup' );
that's the problem, but I've even tried remove_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' )
to get rid Twenty Eleven's function and still my functions aren't changing anything...
Can you help?
Here's the functions.php code in full:
Here's the functions I've added to /mychildtheme/functions.php
function clientname_continue_reading_link() {
return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Read more... <span class="meta-nav">→</span>', 'clientname' ) . '</a>';
}
function clientname_auto_excerpt_more( $more ) {
return ' …' . clientname_continue_reading_link();
}
add_filter( 'excerpt_more', 'clientname_auto_excerpt_more' );
Thanks,
Osu
© Stack Overflow or respective owner