Excerpt for Chinese Language.

Home » Troubleshooting » Excerpt for Chinese Language.
Troubleshooting No Comments

Due to the nature of the Chinese language chars, you will need to modify the code a little bit that control the excerpt functions to get it working properly, please edit this file:
You need to change 3 files

1. class-modules.php ( For Shortcode Modules, Map Modules )
/wp-content/plugins/javo-directory-core/shortcodes/class-module.php

Original : http://prntscr.com/b3fm32
For Chinese : http://prntscr.com/b3flvv

This is the code you can change
// for unicode languages
if( function_exists( 'mb_substr' ) ){
$strExcerpt = mb_substr( $post->post_content, 0, $this->lghContent ) . '...' ;
}else{
$strExcerpt = str_replace( '%', '%%', wp_trim_words( $post->post_content, $this->lghContent, '...' ) );
$strExcerpt = sprintf( "<span class='meta-excerpt'>%s</span>", $strExcerpt );
}

 

2. functions-box-map.php ( For Shortcode Modules, Map Modules )
/wp-content/themes/javo-directory/library/functions/functions-box-map.php
http://prntscr.com/b3fjq8

$arrBasicModuleOption = Array(
'length_content' => 12, // <===== Change it to 70 or what you want.
'length_title' => 10,
);

You can setup some of blocks length and it will be working
http://prntscr.com/b3flos

 

3. class-template.php ( For My pages )
javo-directory / includes / class-template.php
find this function : dashboard_mylists
change length on this : 'module_contents_length' => 80,

http://prntscr.com/b3gisl

 

Additional tip : If you want to remove (hide) any shortcodes in excerpt, please add this.

File : /wp-content/plugins/javo-directory-core/shortcodes/class-module.php

Add “strip_shortcodes()”.
Before
$this->excerpt = $this->getContents();
After
$this->excerpt = strip_shortcodes($this->getContents());

http://prntscr.com/ba28hh

Please make sure that listing descriptions is not designed for adding shortcodes. you need to find shortcodes which are working with our theme, if you want to add.

 

Thank you,