get_next_posts_link() returns no result despite available posts

Question

I am developing a custom theme based on the Genesis framework. I want to display a ‘previous post | next post’ navigation below any article in the single post view. However, neither get_next_posts_link() nor get_previous_posts_link() return any value. All output I can see is

|

Of course, there are adjacent posts available.

My code looks something like this

single.php

<?php
  
  function myslug_render_post_navigation(){
    echo get_next_posts_link( __( 'Previous post' ) ) . ' | ' . get_previous_posts_link( __( 'Next post' ) );
  }
  add_action( 'genesis_after_entry', 'myslug_render_post_navigation' );
  
  genesis();

Can anyone point me in the right direction?

0
, , Bunjip 1 year 2020-07-14T01:10:24-05:00 0 Answers 68 views 0

Leave an answer

Browse
Browse