';
}
}
add_filter('excerpt_more', 'apadana_excerpt_more');
if (!function_exists('apadana_excerpt_length')) {
function apadana_excerpt_length($len)
{
$excerpt_length = get_theme_mod('apadana_option_excerpt_length');
return (!empty($excerpt_length) ? $excerpt_length : 65);
}
}
add_filter('excerpt_length', 'apadana_excerpt_length', 999);
/**
* ------------------------------------------------------------------------------------------
* Function that return the excerpt
* with the given character length
* ------------------------------------------------------------------------------------------
*/
if (!function_exists('apadana_the_excerpt_max_charlength')) {
function apadana_the_excerpt_max_charlength($charlength, $post_id)
{
global $post;
(empty($post_id)) ? $post_id = $post->ID : $post_id;
$excerpt = get_the_excerpt();
$charlength++;
if (mb_strlen($excerpt) > $charlength) {
$subex = mb_substr($excerpt, 0, $charlength - 5);
$exwords = explode(' ', $subex);
$excut = -(mb_strlen($exwords[count($exwords) - 1]));
if ($excut < 0) {
$excerpt_text = mb_substr($subex, 0, $excut);
} else {
$excerpt_text = $subex;
}
$read_more_text = get_theme_mod('apadana_option_read_more_text');
$excerpt_text .= '...
';
} else {
$excerpt_text = $excerpt;
}
return $excerpt_text;
}
}
/**
* ------------------------------------------------------------------------------------------
* Function that change all the more Link of Posts
* ------------------------------------------------------------------------------------------
*/
if (!function_exists('apadana_modify_read_more_link')) {
function apadana_modify_read_more_link()
{
global $post;
$more_sectiton_code = '';
if ($post->post_type != 'attraction') {
$more_sectiton_code .= '';
}
return $more_sectiton_code;
}
}
add_filter('the_content_more_link', 'apadana_modify_read_more_link');