Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1183200

    Hi,
    I noticed an issue with the previous/next navigation on the portfolio this morning. The posts are no longer locked into their respective categories.

    For example:
    http://mgm.smallingonline.com/portfolio/retail/

    When you click on Shades of time at FLL, on the right side of the screen you click to go to the next project and it says “Hoffman’s Chocolates,” but in the retail category it should be “The Port Retail.”

    Just an FYI, I am running this filter to swap left/right arrows:

    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;
    }

    • This topic was modified 4 years, 9 months ago by tsmalling.
    #1184037

    Hey tsmalling,

    Thank you for the inquiry.

    You should also use the avf_post_nav_settings filter to enable the same_category parameter or set it to true. Please check the thread below.

    // https://kriesi.at/support/topic/previous-next-portfolio-post-buttons/#post-1173504

    Best regards,
    Ismael

    #1184039

    Hi Ismael,
    I tried adding that into the functions, cleared the cache, but it didn’t work. I even commented out other settings and I am still having an issue keeping it in the same category. Any other suggestions?

    #1184423

    Hi,

    Thank you for the update.

    The same_category parameter is actually working but not how you expect it to. The item Hoffman’s Chocolates displays after the Shades of time at FLL item because they both belong in the same category called Airport/Aviation. You have to remove the item Shades of time at FLL from that category if you want the post navigation to fetch the next item in the Retail category, which is the The Port Retail item.

    Best regards,
    Ismael

    #1184593

    Thanks, Ismael!
    So, if I am understanding correctly, using my current setup I cannot put the projects in multiple categories because I will have this issue, Beyond making lots of duplicate portfolio items, is there anything else I can do to accomplish this?

    #1185080

    Hi,

    Yes, that is correct. There is an available filter that you can use to adjust the query for the post navigation, but we might not be able to help you adjust it based on your requirements due to time constraints. You can find an example here:

    // https://adambrown.info/p/wp_hooks/hook/get_%7B$adjacent%7D_post_join

    Thank you for your patience.

    Best regards,
    Ismael

    #1185468

    Hi Ismael,
    Thank you for pointing me in the right direction. I may try to adjust the query, or tell the client we’ll need to find a different approach,

    #1185676

    Hi tsmalling,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

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