Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="excerpt">
- <p>
- <?php
- $ln = 180;
- if ( is_user_logged_in() ) {
- if (!empty($post->post_excerpt)) {
- if (strlen(strip_tags(strip_shortcodes($post->post_excerpt))) > $ln) {
- echo mb_substr(strip_tags(strip_shortcodes($post->post_excerpt)), 0, $ln) . '[...]';
- } else {
- echo strip_tags(strip_shortcodes($post->post_excerpt));
- }
- } else {
- if (strlen(strip_tags(strip_shortcodes($post->post_content))) > $ln) {
- echo mb_substr(strip_tags(strip_shortcodes($post->post_content)), 0, $ln) . '[...]';
- } else {
- echo strip_tags(strip_shortcodes($post->post_content));
- }
- }
- }else{
- if ( !tools::is_nsfw( $post -> ID ) ) {
- if (!empty($post->post_excerpt)) {
- if (strlen(strip_tags(strip_shortcodes($post->post_excerpt))) > $ln) {
- echo mb_substr(strip_tags(strip_shortcodes($post->post_excerpt)), 0, $ln) . '[...]';
- } else {
- echo strip_tags(strip_shortcodes($post->post_excerpt));
- }
- } else {
- if (strlen(strip_tags(strip_shortcodes($post->post_content))) > $ln) {
- echo mb_substr(strip_tags(strip_shortcodes($post->post_content)), 0, $ln) . '[...]';
- } else {
- echo strip_tags(strip_shortcodes($post->post_content));
- }
- }
- }else{
- echo options::get_value( 'general' , 'nsfw_content' );
- }
- }
- ?>
- </p>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement