Roy
(@gangleri)
I suppose this can be done by some php command, but there’s also a plugin to do what you want.
Try this code:
<?php
$lastposts = get_posts('numberposts=1&category=1');
foreach($lastposts as $post) :
setup_postdata($post);
?>
<a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
<?php the_content(); ?>
<?php endforeach; ?>
You can use other parameters to determine witch post you want to show like $offset
Have a look at that codex page for further reference
http://codex.wordpress.org/Template_Tags/get_posts
The PHP above is more what I’m looking for (not plugin), but it’s not working for me. I copied and pasted the complete code into the HTML of the home page that I want it to appear and no go. I also copied it into the design index template and it did not work.
I really want/need this to work. Any ideas? Just figures – I’m having this kind of day already. When I see the published view, it’s displaying……
global $post;
$myposts = get_posts(‘numberposts=5&offset=1&category=5’);
foreach($myposts as $post) :
?>
Um, and I know how to copy paste but it’s displaying part of the PHP in published view! Now, I do not know PHP – please do not expect me to know more than copying and pasting.