You have to reset every instance of a custom query, otherwise you will get unexpected output from any other query there after
Simply use wp_reset_postdata()
after every custom query.
Example
<?php
$args = array( 'numberposts' => '1', 'meta_key'=>'_thumbnail_id' );
$recent_posts = wp_get_recent_posts( $args );
foreach($recent_posts as $post) : ?>
<?php get_template_part( 'content', '' ); ?>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
//NEXT CUSTOM QUERY
EDIT 1
Why not use WP_Query
as well for your wp_get_recent_posts
query. Here is a bump up of all your code together. You just need to make sure that your meta_key is correct
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
<?php
$args = array( 'posts_per_page' => '1', 'meta_key'=>'_thumbnail_id' );
$recent_posts = new WP_Query( $args ); ?>
<?php while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); ?>
<?php get_template_part( 'content' ); ?>
<?php endwhile; // end of the loop. ?>
<?php wp_reset_postdata(); ?>
<?php
$getPorftolio = new WP_Query( 'post_type=portfolio&posts_per_page=4' );
if ($getPorftolio->have_posts()) {
while ($getPorftolio->have_posts()) {
$getPorftolio->the_post();
get_template_part( 'content', 'portfolio-index' );
}
}
wp_reset_postdata();
?>
Note: if your template is called content.php, just call it as get_template_part( 'content' );