Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a shortcode that just retrieves some info from the options table in the database.

For whatever reason, when the content reaches a certain character limit the_content() to return blank?

The function is pretty basic and I can't for the life me figure out why this is happening?

Here's an example of the code:

function my_custom_shortcode() { return get_option('my_custom_shortcode'); }
add_shortcode('MYSHORTCODE', 'my_custom_shortcode');

Has anyone experienced this before? Thanks!

share|improve this question
    
What is the character limit? That column should be a LONGTEXT data type (codex.wordpress.org/Database_Description#Table:_wp_options), so the size shouldn't be a problem. –  GavinR Nov 8 '11 at 5:11
    
Cole, please go back an work (comment/accept/edit question/answer) on your old questions. You're already at a point, where high rep users will step back from answering further questions. –  kaiser Sep 29 '12 at 13:40
add comment

2 Answers

In some occasions the_content() will also return blank if a single post/page is viewed and the loop is not initiated. Meaning that you will have to use the code below to be able to see output from the_content.

if ( have_posts() ) : while ( have_posts() ) : the_post();
   the_content();
endwhile; endif;
share|improve this answer
add comment

Fixed my problem! I was finally able to find some info out there in the vast internet. Visit this site for info on fixing this odd issue.

Over all using the remove_filter('the_content','wpautop'); did the trick.

http://www.undermyhat.org/blog/2009/07/sudden-empty-blank-page-for-large-posts-with-wordpress/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.