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
Ok, so after much frustration, I found a solution to this (I thought Child Themes were meant to speed things up!?). I believe this works because ‘after_theme_setup’ is run once the parent theme has been set up meaning you can remove / override Twenty Eleven’s functions at that point.
If I’ve understood correctly, according to this documentation, the Child Theme is run first, then the parent and then the ‘after_theme_setup’ bit of code in your Child Theme’s functions.php file:
http://codex.wordpress.org/Child_Themes#Using_functions.php
and
http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme
This is what’s in my Child Theme’s functions.php file, hope this helps someone: