WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Excerpt in subscription email (6 posts)

  1. cheauyuin
    Member
    Posted 1 year ago #

    I'm on WordPress 3.5.1 and plugin 8.9.1.

    It seems like the excerpt does not work on utf-8 encoding. My blog is on chinese characters and in the subscription email, full body was included instead of excerpt.

    Any idea how to solve?

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cheauyuin,

    I use UTF-8 myself so I don't think it has anything to do with the character encoding specifically, although it may be the combination of the encoding and your current language.

    I don't know much about the chinese language but are there spaces like in Western languages?

    Subscribe2 creates the excerpt one of three ways, in the following order:
    1/ Take the excerpt as written by the post author.
    2/ Take the content before the HTML more tag.
    3/ Take the first 50 words or so using spaces as delimiters.

    So, if there is no defined excerpt, no more tag and there are no spaces in the content then the entire content would get used.

    The 'fix' would be to write your own excerpt or use a more tag if the above seems likely.

  3. cheauyuin
    Member
    Posted 1 year ago #

    @mattyrob

    I guess I know why, Chinese characters doesn't require spaces in between words, and delimiters could appear in between 10 or more words, and no spaces between delimiters and words required!

    Thanks for your prompt reply. Looks like I'm going to write my own excerpt. Thanks! ;)

  4. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cheauyuin,

    Thanks for following up and teaching me more about Chinese. You can programmatically change the excerpt length with a filter. Write your own little plugin and use code like this:

    function my_excerpt() {
    	// return whatever number of words you want the excerpt length to be
    	return 30;
    }
    add_filter('s2_excerpt_length', 'my_excerpt');

    That would remove the need for you to create your own excerpt. You would need to use a very low number - like 1 or 2 to capture the text before the first delimiter.

  5. cheauyuin
    Member
    Posted 1 year ago #

    Thanks, mattyrob!

  6. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cheauyuin,

    You are most welcome.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags