Tagged: portfolio items
GOAL:
To create a page with a sortable portfolio grid with video portfolio items that open in a lightbox on the same page.
ISSUE:
When adding Portfolio Items / Overwrite Portfolio Link setting / Define Custom Link / Link portfolio item to external URL / it duplicates the Previous and Next lightbox links. If the user clicks on the Next button when viewing portfolio item 01 in a lightbox, it goes to portfolio item 01 again, instead of portfolio item 02.
EXPECTED RESULT:
When viewing page with the portfolio grid and video lightbox portfolio item 01, clicking the next button goes to video lightbox portfolio item 02.
If in the page you set the Link Handling to ‘Display the big image in a lightbox’ this solves the issue for images, but when leveraging the Define Custom Link / Link portfolio item to external URL, i.e. YouTube video, the ‘Display the big image in a lightbox’ persists with the Big Image, not the Overwrite Portfolio Link Setting / Define Custom Link
Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
Josue
Hi!
Yes, that seems to be an unexpected result, the problem is that both the image and the title are linking to the same link, therefore creating a double lightbox.
Here’s a fix, try adding this to theme / child theme functions.php:
function change_portfolio_title_link($title_link, $entry) {
$title_link = $entry->permalink;
return $title_link;
}
add_filter('avf_portfolio_title_link', 'change_portfolio_title_link', 10, 2);
That will force the portfolio title to always link to the permalink wether or not a custom link is defined.
Regards,
Josue