How to change excerpt link text (‘Continued’)?
-
Hi,
I’ve been trying to change the default “… Continued” text/link following an excerpt();.
This didn’t work:
<?php the_excerpt( 'L?s mer', false );
seems like it’s just overridden, it doesn’t matter what I write within the parentheses.I’ve also tried changing the text through functions.php, but I’m going to assume Virtue has it’s own function doing this exact thing and that’s why it won’t work.
The WP codex tells us this:
If you are using a Child Theme, the above code will not work without modification if the parent theme has its own filters setting its own “more” link. You will need to use the remove_filter() function to remove the parent’s filters for yours to work. The problem is your functions.php file is loaded before the parent’s functions.php, so at the time of your file’s execution, there is no filter to remove yet, and your remove_filter() code will fail without warning.
The key is to put your remove_filter() code in a function that executes from an action hook that triggers after the parent theme is loaded. The following code is an example of the additional code needed to get the above code to work from a child theme of the parent theme Twenty Eleven. You will need to examine your actual parent theme’s code for the correct parameters in the remove_filter() code, they must exactly match the add_filter() parameters used by the parent.
Any tips?
- The topic ‘How to change excerpt link text (‘Continued’)?’ is closed to new replies.