Last active
October 29, 2015 09:01
-
-
Save mo3aser/1a1b315e9540514a353d to your computer and use it in GitHub Desktop.
Sahifa Theme - How To Fix Chinese Language Excerpts Issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# 1- Edit framework/functions/theme-functions.php and find: | |
function tie_excerpt(){ | |
add_filter( 'excerpt_length', 'tie_excerpt_global_length', 999 ); | |
echo get_the_excerpt(); | |
} | |
function tie_excerpt_home(){ | |
add_filter( 'excerpt_length', 'tie_excerpt_home_length', 999 ); | |
echo get_the_excerpt(); | |
} | |
# 2- Replace it with: | |
function tie_excerpt(){ | |
add_filter( 'excerpt_length', 'tie_excerpt_global_length', 999 ); | |
echo mb_substr( get_the_excerpt(), 0, tie_excerpt_global_length() ); | |
} | |
function tie_excerpt_home(){ | |
add_filter( 'excerpt_length', 'tie_excerpt_home_length', 999 ); | |
echo mb_substr( get_the_excerpt(), 0, tie_excerpt_home_length() ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment