|
|
|||||||
| Register | FAQ | Calendar | Radio and TV | NP Shop | Search | Today's Posts | Mark Forums Read |
| Blogging Forum Blogging Discussion Forum, links and tools. |
![]() |
![]() |
![]() |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Lets all help Meat find a wife
Join Date: Oct 2007
Posts: 278
Points: 1,390
|
Recent posts PHP call in WP sidebars
Does anyone know the php call for recent posts in Wordpress?
I have this for pages: <?php wp_list_pages('sort_column=menu_order&title_li='); ?> I tried this for posts: <?php wp_list_posts('sort_column=menu_order&title_li='); ?> Didn't work LOL. It must be there somewhere. Any ideas? |
|
|
|
|
|
#2 (permalink) |
|
Lets all help Meat find a wife
Join Date: Oct 2007
Posts: 278
Points: 1,390
|
I should point out, this is for the sidebar template. I've got as far as this now:
get_posts() Still not working but at least it's a valid call now. Does anyone know the arguments for 10 posts, ordered by date? |
|
|
|
|
|
#3 (permalink) |
|
Lets all help Meat find a wife
Join Date: Oct 2007
Posts: 278
Points: 1,390
|
Don't worry - I worked it out
For future reference, this should work fine:<ul> <?php $lastposts = get_posts('numberposts=10'); foreach($lastposts as $post) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
![]() |
![]() |