• Greeting, I am running two WordPress on the same server, on in the root (WP1) and other in blog directory (WP2). I use the following code to display the latest 5 posts from the WP in the root directory (WP1). It works when I used it in a non WP related php file. But when I put the code in WP2, it simply display the recent posts of WP2, not WP1 which is what I want.

    define(‘WP_USE_THEMES’, false);
    require(‘/home/xxx/public_html/wp-load.php’);
    query_posts( ‘posts_per_page=5’ );

    I try to use require_once and include function to include the php file but failed. Any help?

    I followed the tutorial here: http://epiphenie.com/tutorials/show-your-wordpress-blog-on-your-outside-website

  • The topic ‘How to display WordPress content in other WordPress’ is closed to new replies.