Site logo

Archived topic

Blog post Excerpt and Read more issue

5 replies · Started by bwlm on July 27, 2022

Viewing posts 1–6 of 6

I have GeneratePress Premimum installed, when I create posts in English, it showed an Excerpt under 20 words and a Read more button, however, if I create posts in Chinese/Japanese, the Excerpt function doesn't work (the posts are in long form) and the Read more buttons are not there either.

How can I fix this? Thank you!

Hello there,

The excerpt count is controlled by WordPress, and it doesn’t work properly for some languages. GP has no control over this.

For Chinese, you can try this: https://docs.generatepress.com/article/fixing-wordpress-excerpts-word-count-in-chinese/

For Japanese, I found this: https://wordpress.org/support/topic/cannot-count-the-number-of-japanese-excerpt-words/

You’ll probably need a conditional statement to check if the excerpt is in Japanese too: https://stackoverflow.com/questions/2856942/how-to-check-if-the-word-is-japanese-or-english-using-php#:~:text=A%20quick%20solution%20that%20doesn%27t%20need%20the%20mb_string%20extension%3A

Hope this helps!

Then, where shall I add the PHP snippet? Many thanks!

Thank you!

You’re welcome!

This archived topic is closed to new replies.