Hi @bodtje!
On code added by @dorsch
Part of the code is missing. So you get the error.
This is the correct code:
function custom_excerpt($text) { // custom 'read more' link
if (strpos($text, '[...]')) {
$excerpt = strip_tags(str_replace('[...]', '... <a class="more-link" href="'.get_permalink().'">Read More...</a>', $text), "<a>");
} else {
$excerpt = '<p>' . $text . '<a class="more-link" href="'.get_permalink().'">Read More...</a></p>';
}
return $excerpt;
}
add_filter('the_excerpt', 'custom_excerpt');
Please follow the next steps to fix the plugin error:
= Q. What to do if this plugin crashed the website? =
A. This plugin has a built-in function for checking the custom code for syntax errors, duplicate functions names, and etc. But the plugin is not perfect, so there are times when the entered custom code causes the error and white screen (WSOD). This is due to the fact that your custom code has a syntax error that this plugin could not detect. When this happens with you, please perform the following steps.
1. Access your server via FTP or SFTP. If you aren’t sure how usually your web hosting provider will have instructions somewhere on their website.
2. Browse to the directory wp-content/plugins/my-custom-functions/
. Please contact your web hosting company to get help if you can’t find this folder.
3. Rename the file START
to STOP
. This will stop the execution of your custom code.
4. Log in to the Admin Area of your WordPress website.
5. Go to the plugin settings page Settings
-> PHP Inserter
.
6. Edit/fix your custom PHP code that you entered before the crash.
7. Return to the plugin folder and rename the file STOP
to START
and you’re done!
PS. As the @dorsch correctly mentioned, you have to switch off “Read More”-links in the customizer, otherwise it is doubled on posts without a manual excerpt. (Customizing ? Blog ? General)
Regards
-
This reply was modified 5 years, 1 month ago by themevision.