Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #651336

    Jade
    Moderator

    Hi Kelley,

    You’re most welcome. Currently we can only extract and display the portfolio images in the LightBox. This is possible but it requires more customization which falls beyond our support. Thank you for your understanding.

    #697577

    kelleynunn
    Participant

    Hey, ThemeCo!

    So a few weeks ago, I added the code you guys gave to me in post #651121 that allowed portfolio items to open in a lightbox. Everything seemed to be working ok, but the lightbox does not seem to be responsive with mobile devices and tablets. (There are all sorts of overlapping and visibility issues when viewing the lightbox items in mobile.) Is this just a limitation of ilightbox? Do you have any suggestions as to how to make the lightbox more reponsive?

    Any help would be greatly appreciated, thank you!

    -Kelley

    #698051

    Nabeel A
    Moderator

    Hi Kelley,

    I’ve checked your portfolio page, it seems like the some of your images are of low resolution and some are of high resolution, that’s why they overlap in small resolution. You can try uploading the images of same resolution to avoid image overlapping.

    Hope this helps!

    #702933

    kelleynunn
    Participant

    ThemeCo,

    Ok– I’ll try playing with the resolution of the images to see if that will help. In the meantime, is it possible to prevent the use of iLightbox in mobile devices & tablets? Meaning, can images open into iLightbox on desktops, but be unclickable in mobile?

    Thank you for your help!

    -Kelley

    #703346

    Rad
    Moderator

    Hi there,

    That’s possible, for example, let use a custom class lightbox-desktop.

    [image class="lightbox-selector lightbox-desktop"]
    [lightbox selector=".lightbox-selector"]

    Then you can simply add this code at Admin > Appearance > Customizer > Custom > Javascript.

    jQuery('.touch .lightbox-desktop').off('touchstart touchend click').on('click', function(e){ e.preventDefault(); e.stopPropagation(); } );

    Hope this helps.

    #703955

    lparker2
    Participant

    Hi,

    Is this something you could help me set up?

    I am only planning on adding photos to the site using the portfolio. I would like the user to be able to click on the recent post and the image show in a light box rather than navigating away to another page.

    Also, I would like the images on the portfolio page to simply open up in a lightbox.

    Thanks.

    #704281

    Rad
    Moderator

    Hi Iparker,

    I’m afraid, I can’t. Looks like a complex setup which is not yet supported by recent post. Still could be done through custom development.

    Hope this helps.

    #814067

    tadbeavers
    Participant

    Do these steps work for the Integrity theme?

    #814496

    Christopher
    Moderator

    Hi there,

    Please add following code in child theme’s functions.php file :

    // Liking Portfolio Items to Featured Image URL to Open Them in a Lightbox (Integrity)
    // =============================================================================
    
    add_filter( 'post_type_link', 'x_remap_portfolio_to_page', 10, 4);
    function x_remap_portfolio_to_page($post_link, $post, $leavename, $sample) {
    
      if ( 'x-portfolio' == $post->post_type ) {
        return $image_link = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
      }
    
      return $post_link;
    }
    
    add_action('wp_footer', 'enqueue_lightbox_script');
    function enqueue_lightbox_script() {
      echo '
        <script type="text/javascript" src="' . home_url() . '/wp-content/plugins/cornerstone/assets/js/dist/site/vendor-ilightbox.min.js"></script>
        <script>jQuery(document).ready(function($) {
           $(\'.page-template-template-layout-portfolio .entry-featured a\').click(function(e) {
              e.preventDefault();
           });
        });
        jQuery(document).ready(function(){jQuery(".x-portfolio .entry-featured a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});});
      </script>';
    }

    Hope that helps.

    #833959

    venya
    Participant

    Hello,

    I have videos in my portfolio that are all setup as: Media Type – video, Featured Content – Thumbnail.

    Is it possible to open a certain portfolio video (ie, single category) in a video lightbox from portfolio archive page. Tried some of the code here, and it opened my portfolio feature image into the lightbox, not video.

    Hoping this is possible. 🙂

    And if so, can I restrict this action to an individual portfolio category?

    Thank you.

    #833961

    venya
    Participant
    This reply has been marked as private.
    #834249

    Rad
    Moderator

    Hi there,

    Video lightbox is no longer supported, it’s only possible with X shortcodes 3.0 and below. But that is too old. You can use 3rd party plugin or feature that supports video lightbox 🙂

    Thanks for understanding.