Individual Portfolio (Project) Items don't have back/forward arrows to scroll to the next project (Ethos Stack)

Portfolio Items won’t display the proper navigation that allows the next or previous project to be loaded.
link to dev site: https://studioddev.com/project/stephens-college/ The arrows dont cycle through previous and next projects.

Hi Joe,

Thanks for reaching out.

It’s on the top and working fine on your provided URL.

The code responsible for that is this

  function x_entry_navigation() {

  $stack = x_get_stack();

  if ( $stack == 'ethos' ) {
    $left_icon  = '<i class="x-icon-chevron-left" data-x-icon-s="&#xf053;"></i>';
    $right_icon = '<i class="x-icon-chevron-right" data-x-icon-s="&#xf054;"></i>';
  } else {
    $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;

  ?>

  <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

  }

It’s the previous and next post feature, it’s just styled to display as arrows. Or perhaps it doesn’t work as the way you wanted? In that case, please provide more information as how you wanted it to behave :slight_smile:

Thanks!

Hi Rad, It doesn’t rotate all of the projects there are 26 total as you can see on the Projects page… Only 2 or three of them are shown, once you advance forward there should be 2 icons, (previous and next).

My projects are in essence X-portfolio items just named projects.

Hi Joe,

In that case, would you mind providing your admin login credentials in the secure note for further checking? The code shouldn’t limit the navigation for previous and next items since get_adjacent_post( false is false.

Thanks!

1 Like

Sure I will send it now.

Hello Joe,

Thanks for updating the thread.

I checked the website and can see that the issue with Portfolio navigation links. I tried to troubleshoot the issue but issue is still there. Can you please share FTP login details in secure note so that we can take a closer look?

Thanks.

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

Hi Joe,

This seems to be a bug with https://codex.wordpress.org/Function_Reference/get_adjacent_post and with the combination of other queries for this custom post type. But it works on my end, the only difference are category naming and portfolio item’s that I added. Does this happen before? Please try re-adding your portfolio items with single category for each.

I already changed the code and added to the child theme and only result with the same limit. This isn’t cache related either, I also tried another permalink and also the same so it’s not due to Project naming. I’ll continue checking and it’s a bit weird since it only uses what Wordpress provided get_adjacent_post.

Thanks!

1 Like