I want to create a page on other part on my website (outside wordpress directory) where I can show list of posts from a specific category.
I am looking for exact solution provided by @toscho here:
How to create tabled index of posts in a certain category
For example, if my wordpress site is example.com/blog/
, I want to create a standalone solution (php script) which will show list of posts from the wordpress site based on the category. Something like: example.com/category.php
.
Is this possible with RSS or any other solution?
If files are on the same server & you want to load them from the wordpress environment(using wordpress functions), you can include
wp-load.php
which will load all wordpress files & then useWP_Query
,get_posts
etc. This is dirty but gets the job doneIf you have the database accessible, you can write custom queries to the database, this will be most efficient but you won’t have any wordpress filters applied
It’s possible via feed as well, see this example
or use curl to read feeds, there are tutorials easily available online