tags:

views:

23

answers:

2

I have the following site structure Parent Site -> blog (wordpress) -> get-recent-posts.php -> index.php

I want to display a list of recent posts in the index.php. I am trying to use wordpress api functions in index.php but it is not working. If i try to directly run get-recent-posts.php it shows the posts but if i include it in index.php it does'nt work.

A: 

please be more specific , i personally don't understand what you mean by the following

Parent Site -> blog (wordpress) -> get-recent-posts.php -> index.php

if you want the following setup

http://yoursite.com ( where you can access Wordpress functions )
http://yoursite.com/wordpress ( where your blog resides )

maybe this will help: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

PatrickS
A: 

Adding the following code to the top of the page will do the job. The path should be the absolute or relative path to your wp installation.

<?php 
require_once '.blog/wp-load.php';
>
Hemanshu Bhojak