0

Wordpress states the following:

An excerpt is a condensed description of your blog post and refers to the summary entered in the Excerpt field of the Administration > Posts > Add New SubPanel. The excerpt is used to describe your post in RSS feeds and is typically used in displaying search results. The excerpt is sometimes used in displaying the Archives and Category views of your posts. Use the Template Tag the_excerpt() to display the contents of this field. Note that if you do not enter information into the Excerpt field when writing a post, and you use the_excerpt() in your theme template files, WordPress will automatically display the first 55 words of the post's content.

I wrote a post of 164 words.

And placed this into my posts page:

<div class="mainbar">
            <?php // Create custom loop
            $custom_posts = get_posts('post_type=page_content&page_sections=Content (Front Page)'); ?>
            <?php foreach( $custom_posts as $post ) : setup_postdata( $post ); ?>
                <div class="content-block">
                    <h2><?php the_title(); ?></h2>
                    <?php the_excerpt(); ?>
                </div><!-- .content-block -->
            <?php endforeach; ?>
            <?php wp_reset_query(); ?>
        </div><!-- #mainbar -->

I'm still seeing 164 words in that post.

EDIT:

This is what I've written in the post:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat

.

I tried exceeding 55 words in other post and it is the same story.

Any suggestions?

2
  • Is issue with single specific post or with all posts? Please add example content or link to it, if possible.
    – Rarst
    Commented Jan 28, 2011 at 12:01
  • @Rarst It happens the same in every post. I added an example (EDIT). There's should be something wrong in my loop or the admin panel.
    – wyc
    Commented Jan 28, 2011 at 12:11

1 Answer 1

2

Hi @janoChen:

Are you sure that code it running and not some other code? I just traced through the code and the only way it's going to do that is if you have a plugin or code in your theme that is hooking one of the following hooks: 'the_excerpt', 'get_the_excerpt', 'wp_trim_excerpt' or possibly removed the 'get_the_excerpt' hook that calls wp_trim_excerpt().

What plugins or other code to you have installed?

1
  • Yes, I had that problem you mentioned, already solved it. Thanks.
    – wyc
    Commented Jan 28, 2011 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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