Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter loafintree

    (@loafintree)

    Actually, it appears that the first paragraph is cutoff at the limit but then the subsequent paragraphs are added anyways. Doesn’t make much sense.

    Plugin Author smashballoon

    (@smashballoon)

    Hey loafintree,

    There are two different text length limits you can set within the plugin options. One is for the post text itself, and the second is for the description of the link, photo, video or event that you posted or shared.

    For example, if you write a post and also share a link in that post and that link has a description associated with it then it will also be displayed. You can limit the post text length and also the description text length independently. I don’t see the post on your website that you are specifically referring to but it’s possible that you were setting the post text length to 150 and then seeing the description text beneath it. The plugin also gives you the option to hide the description text completely if you’d prefer not to show it.

    If you have any other questions or issues then just let me know.

    John

    Thread Starter loafintree

    (@loafintree)

    Hi John,

    The post is back (unless someone else posts to the facebook page). I set the description to “0” but it’s still there. Leaving blank gives unlimited. I don’t see anywhere else to suppress the description. –Todd

    Plugin Author smashballoon

    (@smashballoon)

    Hey Todd,

    I see the post you’re referring to. It looks like this is being caused by the WordPress wpautop function being applied to the posts by either your theme or another plugin, which is messing up the formatting of the post by adding extra tags into the HTML output. As the post text length is shortened using JavaScript then these additional tags are preventing it from working correctly. You can see in the demo how it should look when formatted correctly: http://smashballoon.com/custom-facebook-feed/demo/?id=TempleSMC&layout=thumb

    I’ll look into this tomorrow and see if I can come up with a solution for you.

    John

    Plugin Author smashballoon

    (@smashballoon)

    Hey Todd,

    I believe I have a solution. Could you send me a message using the support form on the website so that I can send you an updated version of the plugin to test whether it fixes the issue?

    Many thanks,

    John

    Hi John,
    I’m experiencing the same problem, with additional paragraphs displaying after the maximum post text and description text lengths in place. Could you send the updated plugin of the version to me to test as well?
    Thanks,
    Kate

    Plugin Author smashballoon

    (@smashballoon)

    Hey Kate, I just responded to your email.

    Many thanks,

    John

    dutch_developer

    (@dutch_developer)

    Hi John!

    I think I am encountering the same problem. Have you found a more permanent solution already?

    Thanks!

    Plugin Author smashballoon

    (@smashballoon)

    Hey dutch_developer,

    I’ve experienced the issue with a few different users and it’s usually caused by the theme over-riding the WordPress content formatter with it’s own custom formatting function which is messing up the formatting of the feed. Do you have access to your theme via FTP? If so, could you try adding the following to your functions.php file and then wrapping the [custom-facebook-feed] shortcode in ‘raw’ shortcodes like so: [raw][custom-facebook-feed][/raw]

    Add this to functions.php:

    function cff_formatter($content) {
        $new_content = '';
        $pattern_full = '{(\[raw\].*?\[/raw\])}is';
        $pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
        $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
    
        foreach ($pieces as $piece) {
            if (preg_match($pattern_contents, $piece, $matches)) {
                $new_content .= $matches[1];
            } else {
                $new_content .= wptexturize(wpautop($piece));
                //$new_content .= $piece; <-- uncomment and delete line above to disble wpautop
            }
        }
        return $new_content;
    }
    
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');
    add_filter('widget_text', 'do_shortcode');
    add_filter('widget_text', 'cff_formatter', 99);
    add_filter('the_content', 'cff_formatter', 99);

    Please let me know whether that works for you,

    John

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Maximum Post Text Length’ is closed to new replies.