-
AuthorPosts
-
January 18, 2020 at 3:49 pm #1175845
I’m trying to limit the previous + next buttons of a portfolio grid / lightbox to the current active filter (category).
So fare, I’ve added this code-snippet:/* make previous-next buttons stay within the relevant portfolio category (multiple portfolios) */ 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; }
It limits the lightbox to all selected entries (portfolio grid settings / content / select entries).
But I like to limit lightbox to the current active category (filter). Is there a way to achieve this by chance ?Many thanks in advance.
_______________________________________________________________
EDIT: After a weekend of fiddling around I found a workaround:
1. Add Layout Elements / Tab Section
2. Create tabs according to your categories.
3. Add Content Elements / Portfolio Grid to each tab
4. In Portfolio Grid / Content / Select Entries choose the related category
5. Activate Lightbox (Porfolio Grid / Advanced / Link Settings / Display the big image in a lightbox)
6. Repeat this for each individual tab.
7. Add code from above to your theme-function.phpTo the devs: It would be really nice, if the portfolio grid and lightbox would be extended in the future.
btw, I’ve bought the theme a week ago and I have fallen in love, already :-) Awesome job, keep it up!- This topic was modified 4 years, 11 months ago by Pivou.
January 21, 2020 at 8:43 am #1176604Hey Pivou,
Glad that you found a workaround.
FYI, the callback or function used for the avia_post_nav_entries filter above will only reverse the next and previous navigation, and only display items from the same category. It should not be affecting how the lightbox works.
Thank you for the inquiry.
Best regards,
IsmaelJanuary 21, 2020 at 7:22 pm #1176907Thanks for your confirmation. This thread can be locked.
It would be great, if the developers would consider adding lightbox features like category selection and display excerpt.January 21, 2020 at 8:13 pm #1176924Hi,
If you need additional help, please let us know here int the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Portfolio Grid with Lightbox: Restrict next+previous-Arrows to current category’ is closed to new replies.