shortcode causing the_content() to return blank?

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?

Read More

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!

Related posts

Leave a Reply

2 comments

  1. 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;