Show custom post type randomly in any page

You can write a custom query to get some random posts for your template. The simplest possible solution will be this query:

<?php
// Set the post type here, and sort them randomly
$args = array(
    'post_type' => 'YOUR-POST-TYPE',
    'posts_per_page'=> 5, 
    'order_by' => 'rand',
);
// Initiate a custom query
$my_query = new WP_Query($args);
// If the query has any post, start the loop
if($my_query->have_posts()){
    while($my_query->have_posts()){
        // Output a link and a thumbnail of the post
        $my_query->the_post(); ?>
        <div class="random-post">
            <img src="https://wordpress.stackexchange.com/questions/273438/<?php the_post_thumbnail_url();?>"/>
            <a href="<?php the_permalink();?>"><?php the_title();?></a>
        </div><?php
    }
} ?>

Replace YOUR-POST-TYPE with your actual post type’s name, then paste this code wherever you wish in your template. You can add or remove any element that you wish, if you are familiar with WordPress’s functions.