Tagged: blog posts
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
@Guenni007 thank you! And here I was looking to add more code to the functions.php ¯\_(ツ)_/¯
Thanks again!
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