Created
November 21, 2015 08:48
-
-
Save kharissulistiyo/87688e240cb802d12d94 to your computer and use it in GitHub Desktop.
Zerif Lite WordPress Theme: Display "Continue reading" link in post archive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Zerif Lite version 1.8.2.9 | |
*/ | |
add_filter('get_the_excerpt', 'zerif_add_read_more_link'); | |
function zerif_add_read_more_link($post_excerpt){ | |
global $post; | |
if(strstr($post->post_content,'<!--more-->')) { | |
$more_link = ' <a class="more-link" href="'.esc_attr(get_permalink($post->ID) . "#more-{$post->ID}").'">'.__('Continue reading', 'zerif-lite').'</a>'; | |
return $post_excerpt . $more_link; | |
} | |
return $post_excerpt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment