• Resolved simonw88

    (@simonw88)


    Hi all,
    I’ve Googled, Checked the codex and searched forum for an answer that might be more specific to my problem but have only seen problems with peoples custom implementations of it.

    The problem is all the pages of my site have been fine up until today when displaying their content. However now (and for no discernible reason) all new pages I create are not displaying the_content() string.

    I’ve checked the following to see if I can see why:

    • database entries match the same attributes as other working pages
    • content has been stripped out and some dummy text has been applied to make sure it wasn’t anything in the content
    • the correct template and publish settings are set
    • the same snippet of code is running when loading working pages and non working pages

    I commented out the following line of code from the_content() function
    $content = apply_filters( 'the_content', $content );
    and it successfully displayed the content for my page. However as expected all the formatting was broken (more obviously on every other page of my site).

    I put the line back in and the content vanishes again. Has anybody experienced this before? I cannot for the life of me work out why pages I add now (as opposed to pages I added last week) are not displaying their content. As far as that function filter is concerned isn’t it just a string of content and so what on earth would cause this?

    Within “page.php” the following code is present:

    <?php while ( have_posts() ): the_post(); ?>
    
    			<article <?php post_class('group'); ?>>
    
    				<?php get_template_part('inc/page-image'); ?>
    
    				<div class="entry themeform">
    					<?php the_content(); ?>
    					<div class="clear"></div>
    				</div><!--/.entry-->
    
    			</article>
    
    			<?php if ( ot_get_option('page-comments') != '' ) { comments_template('/comments.php',true); } ?>
    
    		<?php endwhile; ?>

    We are still using the querystring for the permalinks so I know we have the right page.

Viewing 1 replies (of 1 total)
  • Thread Starter simonw88

    (@simonw88)

    This topic is resolved.

    In a freak accident I deactivated the a plugin (a bitcoin exchange ticker widget) and the page started working. Reactivating it broke the content again.

    Frustratingly I see absolutely no link between the two codes but in case anyone runs in to problems like this, think about deactivating all your plugins to see if one of them was the cause, illogical as it may sound.

Viewing 1 replies (of 1 total)
  • The topic ‘apply_filters( 'the_content', $content ) returns empty string.’ is closed to new replies.