Showing posts with label How to chnage character lenght and continue reading text in excerpt in wordpress. Show all posts
Showing posts with label How to chnage character lenght and continue reading text in excerpt in wordpress. Show all posts

Sunday, 13 March 2016

How to chnage character lenght and continue reading text in excerpt in wordpress

How to chnage character lenght and continue reading text in excerpt in wordpress


if you have child theme first remove this filter  i have twenty thierteen theme

function child_theme_setup() {
// override parent theme's 'more' text for excerpts
remove_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );

}
add_action( 'after_setup_theme', 'child_theme_setup' );

after change character lenght in wordpress

function et_excerpt_length($length) {
    return 70;
}
add_filter('excerpt_length', 'et_excerpt_length');

you can change the text of continue reading

function et_excerpt_more($more) {
    global $post;
    return '<a href="'. get_permalink($post->ID) . '" class="view-full-post-btn"> read more....</a>';
}
add_filter('excerpt_more', 'et_excerpt_more');