• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2757

Original WordPress Tutorials & 6000+ Guaranteed Code

Snippets

  • Premium Access
  • Log in

Single Post Navigation With Excerpt

This code produces next and previous post links after all single post entry content.

The single post navigation also includes the excerpt for both the previous and next posts like what you see in this image ( Click image )

single-post-navigation

The solution includes code to make it super easy to change the length of the excerpt.

You can also add too, modify or remove the post meta to include or exclude any of the standard meta like categories, tags, author, date etc.

Here’s the code which goes in your child themes functions file:

Register for full access


Change the 22 in the above PHP code to control the word limit in the excerpt.

And some sample CSS for styling:

.single .post-nav-header .entry-categories,
.single .post-nav-header .entry-time {
    display: inline;
    padding-right: 10px;
}

.single .post-nav-header a {
    text-decoration: none;
}

p.next-post-text,
p.previous-post-text {
    font-size: 28px;
}

p.post-navigation-title {
    font-size: 24px;
}

Pagination

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
 

Loading Comments...
 

You must be logged in to post a comment.