Tagged: 

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

    Is it possible, after scrolling to the last post in a category, to show the first post so the user can loop through again and again?

    I have two custom entires in my functions.php to assist with most of what I need to achieve:

    // scroll posts in same category
    add_filter( 'avia_post_nav_settings', 'enfold_customization_same_cat' );
    function enfold_customization_same_cat( $s ) {
        $s['same_category'] = true;
      return $s;
    }
    
    // reverse order of next and previous
    add_filter('avia_post_nav_entries', 'avia_apply_custom_sort_order_to_post_nav', 10, 2);
    function avia_apply_custom_sort_order_to_post_nav($entries, $settings)
    {
        $temp_prev = $entries['prev'];
        $temp_next = $entries['next'];
        $entries['prev'] = $entries['next'] = "";
        if(!empty($temp_next)) $entries['prev'] = $temp_next;
        if(!empty($temp_prev)) $entries['next'] = $temp_prev;
        return $entries;
    }
    

    Thank you

    #1429780

    have you tried that already:

    #1429821

    @Guenni007 thank you! And here I was looking to add more code to the functions.php ¯\_(ツ)_/¯
    Thanks again!

    #1429861

    Hi,

    Glad to know that @Guenni007 was able to assist you! Please don’t hesitate to start a new thread if you have any further questions.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘loop back to first post in category’ is closed to new replies.