Use an attachment plugin
To link files to the post you can use a plugin like this. I have not used this plugin and there are others, so search well and choose one of them.
These attachment plugins will add fields in editing posts and pages for you to associate files.
Displaying the attachments
Each plugin will also have a way for you to include the files in the preview of posts and pages.
Some plugins make available shortcodes, which is a small text that you put inside the content of the article and the plugin automatically adds the content.
Another way is by using code directly on the screens. The plugin cited above gives the following example:
<?php $attachments = new Attachments( 'attachments' ); /* pass the instance name */ ?>
<?php if( $attachments->exist() ) : ?>
<h3>Attachments</h3>
<p>Total Attachments: <?php echo $attachments->total(); ?></p>
<ul>
<?php while( $attachments->get() ) : ?>
<li>
ID: <?php echo $attachments->id(); ?><br />
Type: <?php echo $attachments->type(); ?><br />
Subtype: <?php echo $attachments->subtype(); ?><br />
URL: <?php echo $attachments->url(); ?><br />
Image: <?php echo $attachments->image( 'thumbnail' ); ?><br />
Source: <?php echo $attachments->src( 'full' ); ?><br />
Size: <?php echo $attachments->filesize(); ?><br />
Title Field: <?php echo $attachments->field( 'title' ); ?><br />
Caption Field: <?php echo $attachments->field( 'caption' ); ?>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
Displaying images
Possibly it is possible to use the same attachment plugin to display the images. Just filter the files that are images and display using the tag <img>
.
If you want another alternative, search for another plugin specifically for image gallery. There are several there that allow you to create galleries and show with shortcodes or custom code.