Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Excerpt/ get post content

function get_excerpt( $count, $more='' ) {
    $permalink = get_permalink($post->ID);
    $content = get_the_content();
    $strip_content = strip_tags($content);
    $excerpt = substr($strip_content, 0, $count);
    $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
    $excerpt = '<div class="article_excerpt"><p>'.$excerpt.'...</p></div><a class="article_more" href="'.$permalink.'">'.$more.'</a>';
    return $excerpt;
}
// calling the function
get_excerpt(150, 'more')
Comment

PREVIOUS NEXT
Code Example
Php :: how to check php version in php 
Php :: get url link in php 
Php :: wordpress custom post type disable add new 
Php :: tl to usd 
Php :: wordpress max post revision 
Php :: delete after 30 days in php 
Php :: how validate array in laravel in request 
Php :: require_once php 
Php :: Flutter migrate to Android Studio 
Php :: hmtl remove tag php 
Php :: select max id laravel 
Php :: php export excel 
Php :: html php pass data to another page 
Php :: validation error message in laravel 
Php :: install php 5.6 on ubuntu 18.04 
Php :: php get client mac address 
Php :: how to get yesterday date in laravel 
Php :: database collection to array 
Php :: php get IP country 
Php :: use model from variable laravel 
Php :: laravel foreach 
Php :: laravel unsigned integer 
Php :: public_path laravel 
Php :: Laravel 5.4 Route back in blade 
Php :: destroy all sessions in laravel 
Php :: brew php version 
Php :: how to set cookie expire time in php 
Php :: implode and explode in php 
Php :: php remove html tag 
Php :: laravel migrate specific table 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =