The problem is that the code works but when i make a post sticky it doesn't appear at first.
The function of the code: It only shows posts that have a thumbnail or a slideshow image.
<?php
$args = array( 'numberposts' => 5,
'meta_query' => array(
'relation' => 'OR',
array(
'key' => '_thumbnail_id',
'compare' => '!=',
'value' => ''
),
array(
'key' => 'slideshow_image',
'compare' => '!=',
'value' => ''
)
)
);
$my_posts = get_posts( $args );
global $post;
foreach( $my_posts as $post ) : setup_postdata($post);
?>
<?php the_post_thumbnail('thumb-small'); ?>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
<?php
endforeach;
wp_reset_postdata();
?>