• Home
  • Blog
  • Showcase
  • Setup Docs
    • Sunshine Help
    • Flex Help
  • Support
    • Support Area
    • Contact us
    • Feedback
  • Connect
    • Newsletter
    • Twitter
    • Facebook
  • My Account
  • Flex
  • Sunshine
Support : Simple Pro Themes

Support : Simple Pro Themes

Reply To: Previous Post & Next Post Settings

If you have purchased a product, please enter the email address that you used to register at time of purchase.
Log In
Lost Password

Create an Account
  • Your username must be unique, and cannot be changed later.
  • We use your email address to email you a secure password and verify your account.

Support › Forums › General Tips › Previous Post & Next Post Settings › Reply To: Previous Post & Next Post Settings

November 25, 2015 at 6:04 pm #683
Davinder Singh Kanith
Moderator

Add the following code at end of functions.php file.

//* Showing post nav in single post page
add_action( 'genesis_after_entry', 'flex_prev_next_post_nav', 5 );
function flex_prev_next_post_nav() {

  if ( ! is_singular( 'post' ) )
    return;

  genesis_markup( array(
  	'html5'   => '<div %s>',
  	'xhtml'   => '<div class="navigation">',
  	'context' => 'adjacent-entry-pagination',
  ) );

  echo '<div class="pagination-previous alignleft">';
  
  if( is_rtl() )
    previous_post_link('<span class="dashicons dashicons-arrow-right-alt2"></span> '. __('Previous Post', 'flex') . '<br/>%link');
  else
    previous_post_link('<span class="dashicons dashicons-arrow-left-alt2"></span> '. __('Previous Post', 'flex') . '<br/>%link');
    
  echo '</div>';

  echo '<div class="pagination-next alignright">';
  
  if( is_rtl() )
    next_post_link(__('Next Post', 'flex') . ' <span class="dashicons dashicons-arrow-left-alt2"></span><br/>%link');
  else
    next_post_link(__('Next Post', 'flex') . ' <span class="dashicons dashicons-arrow-right-alt2"></span><br/>%link');
    
  echo '</div>';

  echo '</div>';
  
}

Copyright © 2021 · Simple PRO Themes for Genesis Framework · About · FAQs · Contact · Affiliates