More information about the Underscore mailing list

[_] wordpress page 'content' not showing up

Chris Dawson chris at tallhat.com
Wed Apr 6 14:19:01 BST 2011

thanks for everyone's help,
i've literally just got this sorted - the theme developer sent me a new
version of the template file. it's to do with multiple/nested 'loops'
apparently, i don't really understand the solution sorry!

the original template used nested 'loops' i think but the new one separates
them.

so the original <?php if ( have_posts() ) : ?> was replaced with
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

along with some other changes. wish i could explain more!


> From: Drew Webber <drew.m.j.webber at gmail.com>
> Reply-To: "underscore at under-score.org.uk" <underscore at under-score.org.uk>
> Date: Wed, 6 Apr 2011 13:17:11 +0100
> To: "underscore at under-score.org.uk" <underscore at under-score.org.uk>
> Subject: Re: [_] wordpress page 'content' not showing up
> 
> Hi Chris,
> 
>> since upgrading to 3.x this content is not showing (the 'posts' loop shows
>> fine underneath).
>> 
>> here's the bit in question from the template
>> ....
>> 
>> <?php $count = 0; ?>
>>        <?php if (have_posts()) : ?>
>> 
>>            <div class="grid_12 clearfix"><?php
>> get_thumbnail_above_post($post->ID, 12);/*hard coded at 12 columns wide
>> since there is only 1 layout style*/ ?></div>
>> 
>>            <?php if(!get_post_meta($post->ID, "hide_content", true)){ ?>
>>                <div class="grid_12 clearfix"><?php the_content(); ?></div>
>>            <?php } ?>
>> 
>> 
>>            <?php $count = 0; ?>
>>            <?php while (have_posts()) : the_post(); ?>
>> ....
>> 
>> it's the
>> <?php the_content(); ?>
>> bit that's no longer working. if i change it to 'the_title' it does display
>> that particular portfolio page's title, but 'the_content' never shows up.
> 
> Looking at: http://codex.wordpress.org/Function_Reference/the_content
> 
> ..specifically the bit about the get_the_content() function:
> 
> [quote]
> Please note! get_the_content will return the unfiltered content. If
> you want to achieve the same output that the_content() returns, use
> the following code:
> 
> <?php
> $content = apply_filters('the_content', $content);
> $content = str_replace(']]>', ']]>', $content);
> ?>
> [/quote]
> 
> ...I wonder whether something has changed in the filtering which is
> not allowing your content through?
> 
> Just for debugging, you could try replacing <?php the_content(); ?> with
> 
> <?php print get_the_content(); ?>
> 
> cheers,
> Drew
> 
> --