I've been really stuck on this and on a tight deadline, basically there is two different wordpress installations. I will call the database which would be to main content: database1 and the one that the content would be loop onto: database2
Basically what I need to happen is the content from database1 to be displayed onto database2 in a loop, with metabox information, title, date, and featured image. This is how far I have gotten so far, this only shows the title and the date.
<?php
$originaldb = new wpdb('blank', 'blank', 'blank', 'blank');
$results = $originaldb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type='press' AND post_status='publish' ORDER BY post_date DESC LIMIT 30" );
if($results):
foreach($results as $post): setup_postdata($post);?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Post Thumbnail -->
<?php the_post_thumbnail(); ?>
<!-- /Post Thumbnail -->
<div class="caption">
<div class="presslink"><a href="<?php $key_1_value = get_post_meta($post->ID, 'presslink', true); if($key_1_value != '') { echo $key_1_value; } ?>" target="_blank" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
<div class="pressdate"><a href="<?php $key_1_value = get_post_meta($post->ID, 'presslink', true); if($key_1_value != '') { echo $key_1_value; } ?>" target="_blank" title="<?php the_title(); ?>"><?php echo get_the_date('M Y'); ?></a></div>
</div>
</article>
<?php endforeach; ?>
<?php else: ?>
Testing has failed
<?php endif; ?>
Any help would be great, I'm not that versed in PHP and SQL.