Tagged: portfolio navigation
-
AuthorPosts
-
February 10, 2020 at 7:49 pm #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, 10 months ago by tsmalling.
February 13, 2020 at 3:33 am #1184037Hey 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,
IsmaelFebruary 13, 2020 at 4:11 am #1184039Hi 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?February 14, 2020 at 8:05 am #1184423Hi,
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,
IsmaelFebruary 14, 2020 at 6:55 pm #1184593Thanks, 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?February 17, 2020 at 5:31 am #1185080Hi,
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,
IsmaelFebruary 17, 2020 at 11:59 pm #1185468Hi 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,February 18, 2020 at 2:50 pm #1185676Hi tsmalling,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.