HEX
Server: Apache
System: Linux linplesk41.pumo.com.tw 3.10.0-962.3.2.lve1.5.27.el7.x86_64 #1 SMP Sat Nov 30 02:18:52 EST 2019 x86_64
User: rajlaw (10192)
PHP: 7.4.24
Disabled: phpinfo,passthru,exec,shell_exec,system,popen,proc_open,proc_close,show_source,pcntl_exec,escapeshellcmd,proc_get_status,proc_nice,proc_terminate,escapeshellarg
Upload Files
File: /home/httpd/vhosts/rajlaw.com.tw/httpdocs/wp-content/themes/freeware/inc/common-functions.php
<?php
/**
 * Functions which enhance the theme by hooking into WordPress
 *
 * @package freeware
 */

//Excerpt More
function freeware_excerpt_more( $link ) {

   $excerpt_text = get_theme_mod('excerpt_text',esc_html__('Read More','freeware'));
    if ( is_admin() ) {
        return $link;
    }

    $link = sprintf(
        '<div class="read-more"><a href="%1$s" class="more-link">%2$s</a></div>',
        esc_url( get_permalink( get_the_ID() ) ),
        /* translators: %s: Name of current post */
        sprintf( $excerpt_text, get_the_title( get_the_ID() ) )
    );

    return ' &hellip; ' . $link;
}

add_filter( 'excerpt_more', 'freeware_excerpt_more' );

//Excerpt length
function freeware_excerpt_length($length) {

    $excerpt_length = get_theme_mod('excerpt_length','40');
    if( is_admin() ){
        return absint($length);
    }

    $length = $excerpt_length;

    return absint($length);
}
add_filter('excerpt_length', 'freeware_excerpt_length');