Hi,
On the page (first link in private content) I have post navigation but I want to reverse the post nav arrows so the left arrow navigates to where the right arrow navigates now. Like in the order you see the items on the second link in private content.
How can I achieve this in my child theme?
Hey,
Please add following code to bottom of functions.php file in Appearance > Editor
add_filter('avia_post_nav_entries', 'avia_post_nav_entries_mod');
function avia_post_nav_entries_mod($entries, $settings)
{
if(is_singular()) {
$entries['prev'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], 'portfolio_entries');
$entries['next'] = get_next_post($settings['same_category'], $settings['excluded_terms'], 'portfolio_entries');
}
return $settings;
}
Best regards,
Yigit
This doesn’t work for me. The post navigation now disappeared
Hi,
Please try this code instead:
add_filter( 'avia_post_nav_entries', 'enfold_customization_postnav', 10, 2);
function enfold_customization_postnav($entries, $settings)
{
$entries['prev'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
$entries['next'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
return $entries;
}
If it doesn’t work please create me an admin account and I’ll look into it.
Best regards,
Peter
Thanks mate! This works perfect!
Hey!
Great, glad we could help you :)
Regards,
Peter