Support » Fixing WordPress » Desperately trying to use the_excerpt function on a page

  • Resolved smm18951


    Hi guys,

    I went to my wordpress admin panel and created a page with this loop in it:

    <br />
    global $post;
    $myposts = get_posts('numberposts=100&order=DESC&orderby=post_date&category=56');
    foreach($myposts as $post) :
    <a href="<?php the_permalink(); ?>"><?php the_title();
                                                                echo "<br />";
    <p><?php the_excerpt(); ?></p><br />
    <?php endforeach; ?>

    The loop displays the_content in stead of the_excerpt. I have read over template hierarchy 2-3 times and I even created a new page template from scratch and no matter how I work things out, I can’t get the_excerpt function to display the excerpt. It only displays the entire content of the post.

    I really need some honest help here, I have been playing with this for a couple of days now.

    Thanks guys

Viewing 8 replies - 1 through 8 (of 8 total)
  • No that won’t display anything. Thanks though. I am wondering if those functions(the_excerpt & wp_trim_excerpt) are missing from my theme or my installation. Can someone tell me where I should be able to find them?


    Change to the WordPress Default Theme, edit wp-content/themes/default/index.php, and change this line:

    <?php the_content('Read the rest of this entry &raquo;'); ?>


    <?php the_excerpt(''); ?>

    Then edit a Post and type something in the Excerpt field. Then visit the main page and you should just excerpts.

    Hi MichaelH…thank you for getting back to me. Are you saying that even though I am using a different theme, I should still adjust the default theme?

    thank you

    Hi Michael…I just tried it, and nothing happened. Everything went the same way as before. I guess that means that my problem has nothing to do with my theme. Do you think it might be possible for one of my plugins to be causing an error? Maybe its my post teaser plugin causing problems.
    Here is a list of my current plugins:

    All in One SEO Pack
    Bookmark Me
    Break Out Of Frames
    Contact Form 7
    Google Analytics for WordPress
    Google XML Sitemaps
    Hotlink 2 Link
    Please Link 2 Me
    Post-Plugin Library
    Post Layout
    Post Teaser
    Similar Posts
    Subscribe To Comments
    Target Blank In Posts And Comments
    WordPress No Pagerank

    Do you think any of them might cause this situation?

    I’d guess Post Teaser, but if that’s not it, might have do deactivate one-by-one to find the culprit.

    sure enough that was it. The post teaser plugin impedes the the_excerpt() function. I guess I should ask the author if he know a work around.

    Thanks MichaelH

    The problem came from the plugin post teaser. The Post Teaser plugin is an awesome plugin and the guy handling the updates and hosting for the site is Han and he is one helpful dude. Unfortunately, I have o uninstall Post Teaser and give Evermore a try. As it turns out Evermore works as a fix for my problem. The only thing I had to adjust on the Evermore plugin was to change the default settings from 1 to 2 paragraphs to be displayed.

    Everything is great now. Thanks to all who tried to help:>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Desperately trying to use the_excerpt function on a page’ is closed to new replies.