-
AuthorPosts
-
August 30, 2016 at 7:04 pm #679638
Hi!
Good day!
I have a portfolio grid set to display the featured image in a lightbox (when clicking portfolio items). I’d like to ask if there’s a way to display the portfolio item’s title and excerpt below the featured image (in a lightbox).
In the mfp-bottom-bar. the mfp-title is empty (this is where I need to place the title and excerpt) and there is mfp-counter.
I have the excerpt field populated in all portfolio items.
Can you help me find/edit the codes (in the portfolio or functions php files, I am not sure where exactly!) to have the lightbox behave as specified above?
Many thanks for all the support!
- This topic was modified 8 years, 2 months ago by melaniecuando.
September 1, 2016 at 8:26 pm #680949Hi, Anyone? Any help would be very much appreciated!
September 5, 2016 at 2:42 am #681883Hi,
We are very sorry for the late response.
This is possible but you have to edit the portfolio items and set the “Overwrite Portfolio Link setting” to “Define a custom link”. Add the url of the featured image. Add this code in the functions.php file to use the excerpt as the lightbox title.
function avf_portfolio_custom_image_container_mod($link_markup, $entry) { $the_id = $entry->ID; $custom_link = get_post_meta( $the_id ,'_portfolio_custom_link', true) != "" ? get_post_meta( $the_id ,'_portfolio_custom_link_url', true) : false; $link = !empty($custom_link) ? $custom_link : get_permalink($the_id); $title = get_post(get_post_thumbnail_id($the_id))->post_title; $link_markup[0] = "a href='{$link}' title='{$entry->post_excerpt}' "; return $link_markup; } add_filter('avf_portfolio_custom_image_container', 'avf_portfolio_custom_image_container_mod', 10, 2);
Best regards,
IsmaelSeptember 5, 2016 at 6:53 pm #682314Thank you! Excellent!
September 5, 2016 at 8:12 pm #682335Hey!
Please feel free to let us know if you need anything else, we will be more than happy to assist.
Thanks a lot
Cheers!
BasilisSeptember 30, 2016 at 10:21 am #693586Hi,
Thank you again it is working great.
I have a related query. When you click on the image in the portfolio gallery, a lightbox opens with the featured image, that is perfect.
However, Is there a way to disable the navigation?
I have set the left and right arrow to “display:none” to prevent users on moving to another image. However, we found out that when you click through the image themselves it navigates to the next image in the gallery.
Hope I am making sense.
Many thanks for the continued support!
October 1, 2016 at 6:15 am #694148Hi,
Please try the following CSS:
img.mfp-img { pointer-events:none; }
Best regards,
RikardOctober 1, 2016 at 8:01 am #694173Perfect! Thanks for the help as always!
October 2, 2016 at 8:04 am #694283Hi,
Glad we could help :-)
Please let us know if you should need any further help on the topic.
Regards,
RikardOctober 11, 2017 at 1:10 pm #862856Hi,
I am also trying to remove the navigation arrows in a Portfolio Gallery – I tried so far all in this forum suggested codes:
a.avia-post-nav.avia-post-prev.with-image {
display: none;
}
a.avia-post-nav.avia-post-next.with-image {
display: none;
}.mfp-counter {
display: none;
}img.mfp-img {
pointer-events:none;
}.mfp-arrow {
display: none;
}So at least the counter is gone (which is good), also when you click on the image in the lightbox do not show the next (which is also good, since there is no way to show only the ones from the same category), but the navigation arrows are still there and I can not remove them. I would like to remove them, because (since there is no solution yet) I do not want to navigate to next picture since the next might be not from the same category.
What I am doing wrong? Which code I need and which one is wrong here?
Thanks in advance!
October 12, 2017 at 10:00 am #863294Hi,
Please try this to remove the navigation arrows:
.mfp-arrow-right, .mfp-arrow-left { display:none !important; }
Best regards,
RikardOctober 12, 2017 at 10:11 am #863298Hi,
Thanks a lot – it is working! Great support!
Best,
AtanasOctober 13, 2017 at 7:41 am #863762February 5, 2020 at 10:58 am #1181702Just wanted to say, that this worked perfectly and still works, even though it’s been more than three years. Thanks!
February 7, 2020 at 5:01 am #1182229Hi Bestone01,
We’re glad to hear that :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Display Featured Image + Title & Excerpt of a Portfolio Item in a lightbox’ is closed to new replies.