I am trying to figure out how to display my entire post navigation in my single.php page but it isn’t working.
Here is a sample post on my single.php file that it currently online.
sample post using my current single.php
I have my post navigation page Here.
The problem is that In my current single.php file, it displays the navigation for the current post, but not all all the post thumbnails. I want it to display all the post thumbnails as navigation underneath the single post. Basically as if I could use like a include(‘index.php’), but that wouldn’t work.
I tried using the_post_navigation(); but it only shows the next post before and after.
Here is my single.php code below
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content() ?>
<div class="entirepost-navigation">
<a href="<?php echo get_permalink(); ?>">
<div class="mainpost">
<div class="mainpostimage" style="background-image:url('<?php echo wp_get_attachment_url(get_post_thumbnail_id()) ?>')"></div>
<h1><?php the_title(); ?></h1></div>
</a>
</div>
<?php endwhile; ?>
<!-- below is the wordpress code to display the post navigation but it only displays the next post before and after but I want it to display all the posts -->
<?php the_post_navigation(); ?>