Created
August 4, 2017 02:16
-
-
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
This file contains hidden or 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
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