Next / Previous Portfolio item to a categorie?

Hi, I use the included essential grid to display 4 collections of furniture:
lights, seating, tables, various.
If i show the collection, like ‘lights’ one can click on a light and will be directed to the single portfolio page.
Now, at the left button of your theme you will be taken to the portfolio-parentcategory page. Ok.
at the right, you’ll find the previous and next buttons. And here’s the problem: The previous and next buttons seem to be NOT linking to the category, but to the whole portfolio database.
Is there a way to include the category, just as the left ‘total overview’ button does? So it skips to the next portfolio item within that category? That would be logical to me.

Link: http://atelier-furniture.com/furniture/retro-lamp/
if you click at the right upper arrows, you’ll be taken to a table instead of a lamp.

thanks for the help.

Did some searching in the old forum. I use ETHOS. I found this code for in a child theme themefunctions.php; is this right?:

// Entry Navigation - In Same Term
// =============================================================================

if ( ! function_exists( ‘x_entry_navigation’ ) ) :
function x_entry_navigation() {

$stack = x_get_stack();

if ( $stack == ‘ethos’ ) {
$left_icon = ‘’;
$right_icon = ‘’;
} else {
$left_icon = ‘’;
$right_icon = ‘’;
}

$is_ltr = ! is_rtl();
if ( x_is_portfolio_item() ) {
$taxonomy = ‘portfolio-category’;
} else {
$taxonomy = ‘post’;
}
$prev_post = get_adjacent_post( true, ‘’, false, $taxonomy );
$next_post = get_adjacent_post( true, ‘’, true, $taxonomy );
$prev_icon = ( $is_ltr ) ? $left_icon : $right_icon;
$next_icon = ( $is_ltr ) ? $right_icon : $left_icon;

?>

<?php if ( $prev_post ) : ?>
  <a href="<?php echo get_permalink( $prev_post ); ?>" title="<?php __( 'Previous Post', '__x__' ); ?>" class="prev">
    <?php echo $prev_icon; ?>
  </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_icon; ?>
  </a>
<?php endif; ?>
<?php } endif;

Hi,

Yes, you can add the following in your child theme’s functions.php file


function x_entry_navigation() {
  $stack = x_get_stack();
  if ( $stack == 'ethos' ) {
    $left_icon  = '<i class="x-icon-chevron-left" data-x-icon="&#xf053;"></i>';
    $right_icon = '<i class="x-icon-chevron-right" data-x-icon="&#xf054;"></i>';
  } else {
    $left_icon  = '<i class="x-icon-arrow-left" data-x-icon="&#xf060;"></i>';
    $right_icon = '<i class="x-icon-arrow-right" data-x-icon="&#xf061;"></i>';
  }
  $is_ltr    = ! is_rtl();
  $prev_post = get_adjacent_post( true, '', false, $taxonomy );
  $next_post = get_adjacent_post( true, '', true, $taxonomy );
  $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_icon; ?>
      </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_icon; ?>
      </a>
    <?php endif; ?>

  </div>

  <?php
  }

Hope that helps.

Did this, but if you now pick up a random portfolio item like http://atelier-furniture.com/furniture/chair-riga-small/ you’ll notice that the arrows are gone. Instead the forward/back arrows are now blank boxes. Any idea how to fix that?

Thanks

Hi,

May I know how are you adding the code, are you using a code editor like dreamweaver or notepad++
or are you adding it via wordpress admin?

Make sure you are adding data-x-icon correctly

eg.

  if ( $stack == 'ethos' ) {
    $left_icon  = '<i class="x-icon-chevron-left" data-x-icon="&#xf053;"></i>';
    $right_icon = '<i class="x-icon-chevron-right" data-x-icon="&#xf054;"></i>';
  } else {
    $left_icon  = '<i class="x-icon-arrow-left" data-x-icon="&#xf060;"></i>';
    $right_icon = '<i class="x-icon-arrow-right" data-x-icon="&#xf061;"></i>';
  }

Thanks

I added the code just by opening the functions.php of the child theme in texteditor (Mac). I re-entered the piece you just send to me; that dit the trick! great. Thanks.

You’re welcome.