• Hiya,

    I’m having a really weird problem – WordPress keep truncating the wp-filebase shortcoe every time I make a change to the page or post. What happens is that every time I change something (unrelated to the wp-filebase shortcode itself), the shortcode gets truncated like this:

    THIS
    [gn_tab title=”something”][wpfilebase tag=list id=’3,4′ tpl=’table_list’ sort='<file_id’][/gn_tab]

    BECOMES THIS
    [gn_tab title=”something”][wpfilebase tag=list id=’3,4′ tpl=’table_list’ sort=’

    gn_tab – shortcode for tabs (Shortcodes Ultimate plugin)
    table_list – my template for displaying list of files

    Now I do have TinyMCE installed, with loads of plugin for it, so maybe some of them are causing this, I’ll have to test this, but I’d love to know if somebody had similar problems.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter fringer

    (@fringer)

    I did some testing and the roblem appears only when I use the shortcode for file listing. I’ve tried omitting the sort order shortcode, but still it doesn’t work.

    Any ideas?

    Thread Starter fringer

    (@fringer)

    This is really weird – two pages, completely the same structure, one works, the other one doesn’t. Evrytime I adda shortcode for Category with id 4, it breaks. I’ve tried adding another category list on the same page and it works. What could be the cause of such behavior?

    Thread Starter fringer

    (@fringer)

    I did yet more testing and it seems that the number of files is the culprit – I have 20 files in the category, and if I remove 1 random file, the category listing displays. As soon as I put the file back int o the category, the page doesn’t dispay.

    What is going on with this? Does anyone have a similar issue with number of files?

    in function.php(template)

    /* truncate
    **************************************************************/
    function truncate($str, $len=80, $etc='') {
        $end = array(' ', '.', ',', ';', ':', '!', '?');
    
        if (strlen($str) <= $len)
            return $str;
    
        if (!in_array($str{$len - 1}, $end) && !in_array($str{$len}, $end))
            while (--$len && !in_array($str{$len - 1}, $end));
    
        echo rtrim(substr($str, 0, $len)).$etc;
    }

    in template page
    <a href="<?php the_permalink(); ?>"><?php truncate(get_the_content(), 90, ' {...}'); ?></a>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress truncates wp-filebase shortcode’ is closed to new replies.