<p class="post-desc"><?php echo cp_get_content_preview( 160 ); ?></p>
function cp_get_content_preview( $charlength = 160 ) {
global $post;
$content = ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post->post_content;
$content = strip_tags( $content );
$content = strip_shortcodes( $content );
if ( mb_strlen( $content ) > $charlength ) {
$content = mb_substr( $content, 0, $charlength ) . '...';
}
if ( post_password_required() ) {
$content = __( 'This content is password protected.', APP_TD );
}
return apply_filters( 'cp_get_content_preview', $content, $charlength );
}
There are currently 1 users browsing this thread. (0 members and 1 guests)