WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
[resolved] How can I make the posting length less? (5 posts)

  1. armen_1982
    Member
    Posted 1 year ago #

    How can I make the posting length less on facebook? For example post only the first sentence or first 20 words.

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

  2. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Two options.

    1st, provide a WordPress Excerpt - WPBook should use that if you provide one.

    2nd, edit code. Specifically wpbook/includes/publish_to_facebook.php

    Lines 152-157 in current version:

    if(strlen($wpbook_description) >= 995) {
         $space_index = strrpos(substr($wpbook_description, 0, 995), ' ');
         $short_desc = substr($wpbook_description, 0, $space_index);
         $short_desc .= '...';
         $wpbook_description = $short_desc;
    }

    If you change the two 995 numbers to something quite a bit shorter it will get truncated when you post.

  3. armen_1982
    Member
    Posted 1 year ago #

    Thanks johneckman, the 2nd option works but want to try the 1st one and dont know how to provide the WordPress Excerpt?

  4. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    @armen_1982 when you are authoring a post in WordPress, underneath the main 'body' section for posts, there is an 'excerpt' section.

    See http://codex.wordpress.org/Excerpt

    If you provide an excerpt, WPBook should use that instead.

    (Note since WP 3.1, the excerpt field may be hidden by default - you may need to show it in screen options)

  5. armen_1982
    Member
    Posted 1 year ago #

    Thanks!!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.