Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #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.
    #680949

    Hi, Anyone? Any help would be very much appreciated!

    #681883

    Hi,

    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,
    Ismael

    #682314

    Thank you! Excellent!

    #682335

    Hey!

    Please feel free to let us know if you need anything else, we will be more than happy to assist.

    Thanks a lot

    Cheers!
    Basilis

    #693586

    Hi,

    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!

    #694148

    Hi,

    Please try the following CSS:

    img.mfp-img {
        pointer-events:none;
    }

    Best regards,
    Rikard

    #694173

    Perfect! Thanks for the help as always!

    #694283

    Hi,

    Glad we could help :-)

    Please let us know if you should need any further help on the topic.

    Regards,
    Rikard

    #862856

    Hi,

    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!

    #863294

    Hi,

    Please try this to remove the navigation arrows:

    .mfp-arrow-right, .mfp-arrow-left {
      display:none !important;
    }

    Best regards,
    Rikard

    #863298

    Hi,

    Thanks a lot – it is working! Great support!

    Best,
    Atanas

    #863762

    Hi Atanas,

    Great, glad we could help :-)

    Best regards,
    Rikard

    #1181702

    Just wanted to say, that this worked perfectly and still works, even though it’s been more than three years. Thanks!

    #1182229

    Hi Bestone01,

    We’re glad to hear that :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Display Featured Image + Title & Excerpt of a Portfolio Item in a lightbox’ is closed to new replies.