Skip to content

Instantly share code, notes, and snippets.

@codervisionbd
Created August 4, 2017 02:16
Show Gist options
  • Save codervisionbd/02b352b84089b455265e48dd4f2fa828 to your computer and use it in GitHub Desktop.
Save codervisionbd/02b352b84089b455265e48dd4f2fa828 to your computer and use it in GitHub Desktop.
The code Is Read More Function For WordPress, You Can use it for read more thank you
function zboom_defult_functions(){
function read_more($limit){
$post_content = explode(' ',get_the_content());
$less_content = array_slice($post_content, 0, $limit);
echo implode(" ",$less_content );
}
}
add_action("after_setup_theme", "zboom_defult_functions");
<p><?php read_more(50); ?>....<a href='<?php the_permalink(); ?>'>[<b>read more</b>]</a></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment