You can use this tag http://wiki.wordpress.org/get_posts
Just modify it for your needs (i.e leave out the “offset”, change the “numberposts” to 6) and you are ready to go.
Make sure you edit the excerpts of your posts, so that it shows the desired portion of the text. (If you do NOT put anything in the excerpt field, it will take a few line from the beginning of your posts.)
the get_posts is working perfectly. now i only have a question about how to get the date returned as a part of the post which i posted under a new thread.
Try adding in the code that you got from the get_posts
start_wp()
ie, something like this (I hope it will show up 🙂
<?php
$posts = get_posts('numberposts=1&offset=0');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); ?>
" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
Of course you can remove the permalink anchor, though it wouldn’t make too much sense.
yes that worked! I also found, interestingly, that a call to the_time returns a time with or without the start_wp.
thankz.
Glad that finally you worked out. Yes, it seems the_time
works even outside The Loop
update for the benefit of future visitors, blogging novices like me: if you want to include an RSS feed in an ordinary static webpage, it’s easily done. Just do a web search for “RSS javascript” (without the quotes) and you should find many many sites offering to generate a few lines of javascript that you can insert into an ordinary .html page. Works great so far.
Here’s one site I like:
http://jade.mcli.dist.maricopa.edu/feed/
I have been using something like <?php $posts = get_posts('category=7&numberposts=1&order=DESC&offset=0'); foreach ($posts as $post) : ?>
on my 1.3 development blog. It worked fine for a while and then it stopped. Anyone have any guesses as to what would make this happen? Maybe something with updated beta code…?