Support » Themes and Templates » the_content() with $more=1 not working

  • Resolved Shasta


    I want to show all the content for posts on a page that isn’t a single-page. The page for the_content says to do this:

    global $more;    // Declare global $more (before the loop).
    $more = 1;       // Set (inside the loop) to display all content, including text below more.

    So I wrote this:

    <?php global $more; $more = 1; //declare and set $more before The Loop ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<?php $more = 1;  the_content(); ?>
    	<?php endwhile; else: ?>
    	<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    	<?php endif; ?>

    Unfortunately it’s still only showing the first two paragraphs. (Oddly it always breaks after the second paragraph, NOT after a certain number of words. Maybe this is a clue?)

    Here is an example page:

    It is displaying the first two paragraphs of two posts. There are more paragraphs not displaying. (There are only two posts though.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael


    Forum Moderator

    there is some hidden html after the four shown paragraphs:

    <div class="post-teaser-block">This is a preview of <q>On a dog appearing</q>. <a href="" title="Permanent Link: On a dog appearing" rel="bookmark">Read the full post (664 words, estimated 2:39  mins reading time)</a></div>	</div>
    </div><!-- #book -->

    which might point to a plugin or some other code that controls the content length; search the activatged plugins if one of them might be interfering; and check functions.php for a possible filter on the content length.



    Thank you. It turns out that the SEO Automatic plug-in includes the Post Teaser plug-in as an option. Although I don’t remember ever having used it, and it reports that it should be off by default (and showed being off) saving the settings (SEO Panel, bottom of the screen, “set plugins”) with them all toggled to off indicated success turning off Post Teaser. (The others indicated they were already off.)

    I had to do it per sub-site (it’s an MU installation) as changing it at the top level didn’t seem to help. Fortunately I only have one sub-site as I’m in development.

    What an unbelievable mess! Thanks for the tip that pointed me in the right direction. My whole post shows now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘the_content() with $more=1 not working’ is closed to new replies.