Replacing ellipsis with link
-
I am working on a child twentytwelve theme and am trying to replace […] with a read more link, but can’t seem to get it to work.
This is what I am using in my child’s functions.php
/* REPLACE [...] GET_EXCERPT WITH LINK */ function custom_excerpt($text) { return str_replace('[...]', '... <a style="font-weight:bold" href="'. get_permalink($post->ID) . '">' . '→ Read More' . '</a>', $text); } add_filter('the_excerpt', 'custom_excerpt');
Any ideas on why this isn’t working? Thanks!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Replacing ellipsis with link’ is closed to new replies.