Title: WordPress truncates wp-filebase shortcode
Last modified: August 20, 2016

---

# WordPress truncates wp-filebase shortcode

 *  [fringer](https://wordpress.org/support/users/fringer/)
 * (@fringer)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/)
 * 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](https://wordpress.org/support/users/fringer/)
 * (@fringer)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/#post-2135548)
 * 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](https://wordpress.org/support/users/fringer/)
 * (@fringer)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/#post-2135552)
 * 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](https://wordpress.org/support/users/fringer/)
 * (@fringer)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/#post-2135577)
 * 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?
 *  [kraudio](https://wordpress.org/support/users/kraudio/)
 * (@kraudio)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/#post-2135728)
 * **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.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-filebase_ffff6e.svg)
 * [WP-Filebase Download Manager](https://wordpress.org/plugins/wp-filebase/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-filebase/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-filebase/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-filebase/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-filebase/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-filebase/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [kraudio](https://wordpress.org/support/users/kraudio/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-truncates-wp-filebase-shortcode/#post-2135728)
 * Status: not resolved