I wish to present earlier and subsequent posts of identical class in wordpress
My code is :
<?php
$prev_post = get_previous_post();
$next_post = get_next_post();
?>
<nav class="post-nav part">
<div class="row no-margin">
<?php // Show the thumbnail of the earlier submit ?>
<div class="col-xs-12 col-sm-6 prev-post" model="padding:0px">
<?php
$prevPost = get_previous_post();
$prevthumbnail = get_the_post_thumbnail($prevPost->ID);
$post_tile=get_the_title($prevPost->ID);
$thumb = wp_get_attachment_image_src(
get_post_thumbnail_id($prevPost->ID), 'full' );
?>
<div class="post-nav-thumb" model="background-image:
url('<?php echo $thumb['0'];?>')" ></div>
<div class="post-nav-content">
<div class="post-nav-subtitle"><?php
previous_post_link('%hyperlink', 'Prev Put up'); ?></div>
<h2 class="post-nav-title"><span><?php
previous_post_link('%hyperlink', $post_tile); ?></span></h2>
</div>
</div>
<?php // Show the thumbnail of the subsequent submit ?>
<div class="col-xs-12 col-sm-6 next-post" model="padding:0px">
<?php
$nextPost = get_next_post();
$nextthumbnail = get_the_post_thumbnail($nextPost->ID);
$post_tile=get_the_title($nextPost->ID);
$thumb = wp_get_attachment_image_src(
get_post_thumbnail_id($nextPost->ID), 'full' );
?>
<div class="post-nav-thumb" model="background-image:
url('<?php echo $thumb['0'];?>')"></div>
<div class="post-nav-content">
<div class="post-nav-subtitle"><?php next_post_link('%hyperlink',
'Subsequent Put up'); ?></div>
<h2 class="post-nav-title"><span><?php
next_post_link('%hyperlink', $post_tile); ?></span></h2>
</div>
</div>
</div></nav>