I am creating a Specialized Page Template, where I want to display list of posts, like the blog (home page). Is it possible to create ‘The Loop’ in that page?
I think I can use get_posts()
to create the loop. Is there any better method?
I am creating a Specialized Page Template, where I want to display list of posts, like the blog (home page). Is it possible to create ‘The Loop’ in that page?
I think I can use get_posts()
to create the loop. Is there any better method?
You must be logged in to post a comment.
Use
get_posts()
to query WordPress.Then instead of the while loop
use the following code:
And it will work like
The Loop
.If anyone knows a better way, please suggest.
I think you should check out the WordPress Codex. It’s very useful.
http://codex.wordpress.org/Template_Tags/get_posts