• Resolved a2cmedia

    (@a2cmedia)


    I’m fairly new to WordPress but am loving it so far ??

    I have a site set up and I am wanting to display the 3 latest post in the side bar of my blog so they will appear on every page.

    I am quite open to suggestions and this is what I have so far which works but not exactly how I want:

    <ul>
    <?php query_posts('showposts=3&orderby=date'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li><strong><a href="<?php the_permalink() ?>"><?php the_title() ?> </a></strong><br />
    <?php the_date(); ?><br />
    <?php the_excerpt(); ?></li>
    <?php endwhile; endif; ?>
    </ul>

    Ideally I would like the excerpt to output plain text, but it seems to have a whole lot of styling applied. Also the_date() tag only works on the first result and not the others.

    Any help is appreciated ??

Viewing 1 replies (of 1 total)
  • Thread Starter a2cmedia

    (@a2cmedia)

    Updated code to:

    <ul>
    <?php query_posts('showposts=3&orderby=date'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li><strong><a href="<?php the_permalink() ?>"><?php the_title() ?> </a></strong><br />
    <?php the_time('F j, Y'); ?><br />
    <?php $excerpt = strip_tags(get_the_excerpt());
            echo $excerpt; ?>
    <?php endwhile; endif; ?>
    </ul>

    And its working perfectly ?? I heart WordPress

Viewing 1 replies (of 1 total)
  • The topic ‘Styling the output of the_excerpt()’ is closed to new replies.