Support » Fixing WordPress » Help with geth_the_excerpts()

  • walshie1987



    I’m having problems with the following code:

    global $post;
    $myposts = get_posts(‘numberposts=3&category=10’);
    foreach($myposts as $post) :

    <td width=”133px” style=”border:none; padding-left:2px; max-width:133px;”>

    <?php echo get_the_post_thumbnail($post->ID, ‘thumbnail’); ?>

    <li style=”padding-left: 2px; text-align:center”>“><?php the_title(); ?><?php
    echo get_the_excerpt($post);?>

    <?php endforeach; ?>

    Basically what should happen is that for the last three posts in category 10 the thumbnail, title and excerpt should be displayed.

    What is actually happening is that the thumbnail and titles are all different (as they should be, as they are different posts) but the excerpt is the same for all three posts.

    I’ve tried everything and can’t figure this out, any ideas?

    Thanks in advance for your help!


Viewing 1 replies (of 1 total)
  • zex2911


    Try instead of

    <?php echo get_the_excerpt($post);?>

    to put

    <?php the_excerpt(); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Help with geth_the_excerpts()’ is closed to new replies.