Last active
December 29, 2015 13:38
-
-
Save yumyo/7678126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$prev_post = get_previous_post(); | |
$id = $prev_post->ID; | |
$permalink = get_permalink( $id ); | |
$next_post = get_next_post(); | |
$nid = $next_post->ID; | |
$permalink = get_permalink($nid); | |
?> | |
<nav class="post-nav"> | |
<span class="nav-previous col-lg-6"><?php previous_post_link( '%link', __( '', '' ) ); ?> | |
<h3> | |
<a href="<?php echo $permalink; ?>"><?php echo $prev_post->post_title; ?></a> | |
</h3> | |
<p> | |
<?php | |
echo wp_trim_words( $prev_post->post_content, $num_words = 26, $more = '<a href="#">Read all ;)</a>' ); | |
?> | |
</p> | |
</span> | |
<span class="nav-next col-lg-6"><?php next_post_link( '%link', __( '', '' ) ); ?> | |
<h3> | |
<a href="<?php echo $permalink; ?>"><?php echo $next_post->post_title; ?></a> | |
</h3> | |
<p> | |
<?php | |
echo wp_trim_words( $next_post->post_content, $num_words = 26, $more = '<a href="#">Read all ;)</a>' ); | |
?> | |
</p> | |
</span> | |
</nav> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment