Wordpress question
Template Tags « WordPress Codex.
I have a Wordpress question, if someone could point me in the right direction…
I have wordpress in domain.com/blog/. On another page (domain.com/index.php), I want to display the latest 10 posts in certain categories. How can I do that? What files do I need to include, and such.
A pointer in the right direction would be enough - I’m just not familiar with the whole Wordpress Way, so not sure which files to start hacking.
Thanks!
November 2nd, 2005 at 3:48 pm
I’d probably start by looking at either /blog/wp-rss2.php or /blog/wp-content/themes/default/index.php
Of course there might be something already existing to do what you want. If each category puts out an RSS feed with the 10 most recent posts, in theory you could just add some PHP code to domain.com/index.php to read and display the items from those feeds. I think magpie would do the trick.
November 2nd, 2005 at 8:16 pm
the codex is your friend…
http://codex.wordpress.org/Template_Tags/get_posts
November 2nd, 2005 at 11:11 pm
Here’s an example of that (which I use on my own website):
http://webreakstuff.com/stuff/index.phps
November 2nd, 2005 at 11:14 pm
One thing I forgot to mention (sorry about the double comment) is that I output the excerpt and not the full article, but you can do just about anything - use wordpress tags just like you would on any other template file.
Drop me an email if you need any help.