excerpt – read more link and number of character to display


/* Set size of characher in excerpt */
function legal_excerpt_length($length) {
// return 35;
$legal_options = get_option( 'legal_theme_options' );
global $post;
if ($post->post_type == 'post')
if(!empty($legal_options['excerptlength'])) {
return __($legal_options['excerptlength']);
} else {
return __('50','legal');
}
}
add_filter('excerpt_length', 'legal_excerpt_length');


/* readmore button if more content */
function legalt_excerpt_more() {
global $post;
if ($post->post_type == 'post') {
return '...<div class="button-div"><a href="' . get_permalink() . '" class="button-read">' . __('Read more', 'legal') . '</a></div>';
}
}
add_filter("excerpt_more", "legalt_excerpt_more");

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: