Need help with lastposts, please
-
Hi everybody,
previous versions I was using the following code to retreive last post on my index page, and now it shows not the latest post, but first.
<?php require('./private/wp-blog-header.php'); ?> <?php get_header(); ?> <div id="content"> <?php $lastposts = get_posts('numberposts=1'); foreach($lastposts as $post) : setup_postdata($post); ?> <h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1> <?php the_excerpt(); ?> <p class="postmeta"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the complete article</a> | <a href="<?php bloginfo('url'); ?>/index.php" rel="bookmark" title="Go to blog">Go to Blog</a> <?php edit_post_link('#',' | ',''); ?></p> <?php endforeach; ?>
need help with this issue, please
- The topic ‘Need help with lastposts, please’ is closed to new replies.