Support » Plugins » Hacks » Problem accesing WordPress within my PHP app

  • Hi!

    I’m accessing the WordPress API from within my PHP code just including the wp-blog-header.php and using get_posts().

    This is working ok when my PHP code is at the same level than the WP directory. For example:

    /blog/[..wp files..]

    At index.php, I have:

    $post = get_posts(…);

    and is working pretty well.

    BUT, when I try to do the same with the code inside a directory, for example:

    /blog/[..wp files..]

    and at folder/index.php I have:

    $post = get_posts(…);

    this always makes my app to redirect to the WP installation (wp-admin/install.php) and doesn’t work.

    Any idea ? Can the API be used from within a directory ?

    The blog is configured correctly and is working ok by itself.


  • The topic ‘Problem accesing WordPress within my PHP app’ is closed to new replies.