I Recently installed wordpress as subdomain on my main website. Now i have two installations: www.example.com and www.example.com/store/. Now i want my Main domain to show recent posts from subdomain in the sidebar of main site.

All i want is:

post->url post->title post->thumbnail

getting post url and title was very easy with the following code "

$products = $wpdb->get_results( "
SELECT * FROM store_posts WHERE post_status = 'publish'
AND post_type = 'post' LIMIT 4" );

My both WordPress installations share the same database but different prefixes and only one image is attached each post (not using featured image function, just attaching image to post)

I don't have much idea for how to join and do custom queries. Kindly help in his regard.

  • 1
    Why are you running two different wordpress installations if you need data access from one to the other? – mor7ifer Mar 11 '12 at 17:15
  • I tried MU but my host doesn't support it, so had to install another WP. – harry Mar 11 '12 at 17:54
  • 1
    Why not just use a custom post type? – mor7ifer Mar 11 '12 at 18:00
  • i need total subdomain with seperate database tables.... – harry Mar 11 '12 at 18:02
  • I know this sounds a little cheap, but you should consider to change the host... – kaiser Mar 12 '12 at 1:31

Sum of the comments/possible solutions plus a third option:

  • Would be possible with a WP MU installation (doesn't work because of host)
  • Custom Post Types (for some reason the OP needs separated DB)
  • There also is the HTTP API built into WP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.