Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1164021

    Hello, I found a topic with exactly the same request, but the solution doesn’t work anymore:
    https://kriesi.at/support/topic/configuring-previous-next-buttons-for-portfolio-items/

    Beside the fact that the lines of the functions-enfold.php, which should be changed, are in line >600 now, unfortunately the changes doesn’t work.

    Is there a way to solve the problem today using a child theme? Thank you!

    • This topic was modified 5 years ago by Jan.
    #1164041

    have you looked to the date of that question ( and solution) ?

    Ok – try this in child-theme functions.php:

    function my_avf_post_nav_entries( array $entries, array $settings, array $queried_entries ){
      $next = $entries['next'];
      $entries['next'] = $entries['prev'];
      $entries['prev'] = $next;
      return $entries;
    }
    add_filter( 'avf_post_nav_entries', 'my_avf_post_nav_entries', 10, 3 );

    __________
    Off-Topic

    to have the same category this would be nice to have:

    function my_avf_post_nav_settings( array $settings ){
      if( true === $settings['is_hierarchical'] ){
        $settings['skip_output'] = true;
        return $settings;
      } 
      if( ! in_array( $settings['type'], array( 'post', 'portfolio' ) ) ){
        $settings['skip_output'] = false;
        return $settings;
      }
      $settings['same_category'] = true;
      $settings['is_fullwidth'] = false;
      $settings['skip_output'] = false; 
      return $settings;
    }
    add_filter( 'avf_post_nav_settings', 'my_avf_post_nav_settings', 10, 1 );
    #1164052

    Works great! Thank you.

    To add the Off-Topic was brilliant …

    #1164203

    Hi,

    Feel free to create a new ticket if you would need something else! :)

    Best regards,
    Basilis

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change Previous / Next buttons in Portfolio items’ is closed to new replies.