Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1211925
    Bill K
    Participant

    Just had a client ask this:

    “Is there an easy way to have nav at the bottom of an individual blog post that allows you to select the next post? It’s just a dead-end when you click into a post otherwise.”

    Thoughts?

    #1212119
    Jade
    Moderator

    Hi Bill,

    Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    #1212120
    Bill K
    Participant

    LOL, I thought it was pretty obvious.

    Just how to add Next/Previous buttons to bottom of posts.

    thx

    #1212548
    Paul R
    Moderator

    Hi Bill,

    To achieve that you can add this in your child theme’s functions.php file.

    
    function add_post_nav(){
      if ( is_singular('post') ){
          x_entry_navigation();
      }
    }
    add_action('x_after_view_global__content', 'add_post_nav');
    
    function x_entry_navigation() {
      $stack = x_get_stack();
      if ( $stack == 'ethos' ) {
        $left_icon  = '<i class="x-icon-chevron-left" data-x-icon=""></i>';
        $right_icon = '<i class="x-icon-chevron-right" data-x-icon=""></i>';
      } else {
        $left_icon  = '<i class="x-icon-arrow-left" data-x-icon=""></i>';
        $right_icon = '<i class="x-icon-arrow-right" data-x-icon=""></i>';
      }
      $is_ltr    = ! is_rtl();
      $prev_post = get_adjacent_post( false, '', false );
      $next_post = get_adjacent_post( false, '', true );
      $prev_icon = ( $is_ltr ) ? $left_icon : $right_icon;
      $next_icon = ( $is_ltr ) ? $right_icon : $left_icon;
      ?>
    
      <div class="x-nav-articles">
    
        <?php if ( $prev_post ) : ?>
          <a href="<?php echo get_permalink( $prev_post ); ?>" title="<?php __( 'Previous Post', '__x__' ); ?>" class="prev">
            <?php echo "Prev"; ?>
          </a>
        <?php endif; ?>
    
        <?php if ( $next_post ) : ?>
          <a href="<?php echo get_permalink( $next_post ); ?>" title="<?php __( 'Next Post', '__x__' ); ?>" class="next">
            <?php echo "Next"; ?>
          </a>
        <?php endif; ?>
    
      </div>
    
      <?php
      }
    

    Hope that helps.

    #1213112
    Bill K
    Participant

    Thank you.

    I submit this as a feature request– should be an option in the Blog section of the Customizer.

    #1213209
    Rahul
    Moderator

    Hey There,

    We certainly appreciate the feedback! All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1211925 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>