How to use the “get_posts” tag?
-
Hello,
I’m trying to create a page that shows a list of all the posts in a paticular catagory. I want to use the “get_post” tag but I have no clue how to use it.
I’ve looked on the wordpress codex page and I sill can’t figure it out.
Here’s what I did..
I add this into my index.php
”
- <?php
global $post;
$myposts = get_posts(‘numberposts=5&offset=1&category=1’);
foreach($myposts as $post) :
?>- “><?php the_title(); ?>
<?php endforeach; ?>
“
Then I would use the “<?php get_posts(‘arguments’); ?>” in the new page html.
I know this is completly wrong becaue it’s not working. Can some please explain how to do this?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to use the “get_posts” tag?’ is closed to new replies.