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

    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?

    #1450622

    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

    #1451651

    WOW! Worked perfectly it seems. Thank you so so much!!

    #1451657

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.