Next/Previous Buttons on Single Portfolio Item

I would like to have a Next/Previous button appear on each portfolio item. I’m not sure if I’m missing this option, and if it’s a simple click to activate it. It’s typically standard on other themes that I’ve worked on, so I’m not sure how to go about this.

Your help would be greatly appreciated.

Thank you.

Hi,

Not sure which Stack you are using but if you are using integrity or Icon Stack, these can be found in the breadcrumbs area

You can enable it in Theme Options > Header > MISCELLANEOUS > Breadcrumbs

For Ethos Stack, it is found across the title

Though for Renew however it is not available. You will need to add it manually using wp actions

Try adding the code below in your child theme’s functions.php

function add_my_nav() {

  $left_icon  = '<i class="x-icon-arrow-left" data-x-icon-s="&#xf060;"></i>';
  $right_icon = '<i class="x-icon-arrow-right" data-x-icon-s="&#xf061;"></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;
  if(x_is_portfolio_item()):
 ?>
 <div class="x-nav-articles" style="clear:both;overflow:hidden;">

    <?php if ( $prev_post ) : ?>
      <a style="float: left;" href="<?php echo get_permalink( $prev_post ); ?>" title="<?php __( 'Previous Post', '__x__' ); ?>" class="prev">
        <?php echo $prev_icon; ?> Previous Post
      </a>
    <?php endif; ?>

    <?php if ( $next_post ) : ?>
      <a style="float:right;" href="<?php echo get_permalink( $next_post ); ?>" title="<?php __( 'Next Post', '__x__' ); ?>" class="next">
        Next Post <?php echo $next_icon; ?>
      </a>
    <?php endif; ?>

  </div>
<?php
endif;
}

add_action( 'x_before_the_content_end', 'add_my_nav', 10 );

Hope that helps

Works. Thank you! I am using the Renew Stack.

You’re most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.