Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1122311
    Brown
    Participant

    Before I updated all of the X theme software, I had the portfolio images successfully set up to open in lightbox with custom functions.php in my child theme, and now they don’t. Any help to get it working again is much appreciated. See example here of images no longer opening in lightbox: http://www.milestoneengcon.com/projects/south-cove-recreation-building/

    This was the custom functions code provided by x-theme support:

    add_action(‘wp_footer’, ‘enqueue_lightbox_script’);
    function enqueue_lightbox_script() {
    echo ‘<script type=”text/javascript” src=”‘ . home_url() . ‘/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js”></script> <script> jQuery(document).ready(function(){jQuery(“.gallery-icon 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>’;

    }

    #1122381
    Christian
    Moderator

    Hey there,

    Please try changing

    wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js

    to

    wp-content/plugins/cornerstone/assets/dist/js/site/vendor-ilightbox.min.js

    Thanks.

    #1122473
    Brown
    Participant

    Thanks, but that didn’t seem to do the trick. I am not using Cornerstone on the Portfolio pages.

    This is the code now:
    // Lightbox Script for Portfolio Single Items Gallery

    add_action(‘wp_footer’, ‘enqueue_lightbox_script’);
    function enqueue_lightbox_script() {
    echo ‘<script type=”text/javascript” src=”‘ . home_url() . ‘/wp-content/plugins/cornerstone/assets/dist/js/site/vendor-ilightbox.min.js”></script> <script> jQuery(document).ready(function(){jQuery(“.gallery-icon 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>’;

    }

    #1122798
    Friech
    Moderator

    Hi There,

    Please do a shortcode instead;

    add_action('wp_footer', 'enqueue_lightbox_script');
      function enqueue_lightbox_script() {
    
        echo do_shortcode( '[lightbox selector=".gallery-icon a" deeplink="true" opacity="0.875" prev_scale="0.75" prev_opacity="0.75" next_scale="0.75" next_opacity="0.75" orientation="horizontal" thumbnails="false"]' );
    
     }

    If that does not work, try to reinstall your Cornerstone. As the lightbox javascript file on your site can not be found.


    screenshot

    Let us know how it goes.

    Thanks.

    #1123676
    Brown
    Participant

    Thank you very much, now works fine.

    #1123800
    Rahul
    Moderator

    Glad that worked for you.

    If you still have any issues with the theme, let us know. We’d be happy to assist you with everything.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1122311 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>