Hi,
I have set up a portfolio grid using only one of the categories set up in my portfolio.
Each item links to its own page and those pages have side links that show previous and next.
Unfortunately those previous or next buttons will take users to an entry that is not in the category specified for the grid.
Is there a way to specify that I want those links only to show the category specified in the grid?
Hey epkdesign,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
add_filter( 'avia_post_nav_entries', 'enfold_customization_postnav', 10, 2);
function enfold_customization_postnav($entries, $settings)
{
if($settings['type'] == 'portfolio')
{
$settings['same_category'] = true;
$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;
}
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
WOW! Worked perfectly it seems. Thank you so so much!!