Sorry for this simple question, I am very new to Wordpress.
I have a simple index.php that show a view of posts, just the images.
When I click on any post, it should send me to the full view of the post, which is defined in the page.php This is the code of my page.php is the same from this answer
<?php get_header() ?>
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content.
the_content();
// End the loop.
endwhile;
?>
<?php get_footer() ?>
It shows the index.php, but in the list of post, it shows just one element, the element that I clicked.
this is my index.php
<?php get_header(); ?>
<body id="page-top">
<!-- Navigation -->
<?php get_template_part( 'navigation'); ?>
<!-- Header -->
<?php get_template_part( 'banner'); ?>
<!-- Portfolio Grid Section -->
<?php get_template_part( 'portfolio'); ?>
<!-- About Section -->
<?php get_template_part( 'about'); ?>
<!-- Contact Section -->
<?php get_template_part( 'contact'); ?>
<?php get_footer(); ?>
And this is the portafolio template, that show the list of all the posts:
<?php
get_template_part('recent', 'posts');
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-md-6 col-lg-4">
<!-- print the post link -->
<a class="portfolio-item d-block mx-auto" href="<?php the_permalink(); ?>">
<div class="portfolio-item-caption d-flex position-absolute h-100 w-100">
<div class="portfolio-item-caption-content my-auto w-100 text-center text-white">
<i class="fa fa-search-plus fa-3x"></i>
</div>
</div>
<!-- print the post image -->
<?php the_post_thumbnail('', array('class' => 'img-fluid')); ?>
</a>
</div>
<?php endwhile; endif; ?>
post
type, thensingle.php
is the more specific template.page.php
is for thepage
post type.