WordPress.org

Ready to get started?Download WordPress

Forums

Modifying this code? (1 post)

  1. xhan104
    Member
    Posted 8 years ago #

    I have this code on my website at the moment, the problem is I would like it to be XHTML valid!
    I know that you can add 'li' etc into the () but I'm not that good! (yet!)


    <?php
    $posts = get_posts('numberposts=3&order=DESC&orderby=post_date');
    foreach ($posts as $post) : start_wp(); ?>
    <div class="sidetitle"><?php the_title(); ?></div>
    <div class="sidedate"><?php the_date(); echo "
    "; ?></div>
    <?php the_excerpt(); ?>
    <?php endforeach; ?>

    Could someone help me out with making it validate, its the only thing stopping my site from being valid.

    I would also like to include a link to the post in say the title or the [...] that comes after the excerpt. Any ideas on how that could be done?

Topic Closed

This topic has been closed to new replies.

About this Topic