Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
Why are you running two different wordpress installations if you need data access from one to the other? –  m0r7if3r 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? –  m0r7if3r 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

1 Answer 1

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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