Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1081328
    tashitendrel
    Participant

    Hello,

    I have this function added to my child theme, which was nicely desplaying indywidual portfolio items in lightbox:

    function x_featured_image( $cropped = ” ) {

    $stack = x_get_stack();
    $page_full = is_page_template( ‘template-layout-full-width.php’ );
    $post_full = get_post_meta( get_the_ID(), ‘_x_post_layout’, true ) == ‘on’;
    $blog_full = is_home() && get_theme_mod( ‘x_blog_layout’ ) == ‘full-width’ && get_theme_mod( ‘x_blog_style’ ) == ‘standard’;
    $archive_full = is_archive() && ! is_post_type_archive( ‘x-portfolio’ ) && get_theme_mod( ‘x_archive_layout’ ) == ‘full-width’ && get_theme_mod( ‘x_archive_style’ ) == ‘standard’;
    $site_full = get_theme_mod( ‘x_’ . $stack . ‘_layout_content’ ) == ‘full-width’;
    $portfolio_full = $stack == ‘integrity’ && is_singular( ‘x-portfolio’ );
    $fullwidth = $page_full || $post_full || $blog_full || $archive_full || $site_full || $portfolio_full;

    if ( has_post_thumbnail() ) {

    if ( $cropped == ‘cropped’ ) {
    if ( $fullwidth ) {
    $thumb = get_the_post_thumbnail( NULL, ‘entry-‘ . $stack . ‘-cropped-fullwidth’, NULL );
    } else {
    $thumb = get_the_post_thumbnail( NULL, ‘entry-‘ . $stack . ‘-cropped’, NULL );
    }
    } else {
    if ( $fullwidth ) {
    $thumb = get_the_post_thumbnail( NULL, ‘entry-‘ . $stack . ‘-fullwidth’, NULL );
    } else {
    $thumb = get_the_post_thumbnail( NULL, ‘entry-‘ . $stack, NULL );
    }
    }

    $portfolio_single_thumb_id = get_post_thumbnail_id( get_the_ID() );
    $portfolio_single_thumb_url = wp_get_attachment_url( $portfolio_single_thumb_id );

    if ( is_singular( ‘x-portfolio’ ) ) {

    printf( ‘%3$s%4$s’,
    esc_url( $portfolio_single_thumb_url ),
    esc_attr( sprintf( __( ‘Expand Image for: “%s”‘, ‘__x__’ ), the_title_attribute( ‘echo=0’ ) ) ),
    $thumb,
    “<script>jQuery(document).ready(function(){jQuery(‘.entry-thumb’).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: true}});});</script>”
    );
    } elseif ( is_singular() ) {
    printf( ‘<div class=”entry-thumb”>%s</div>’, $thumb );
    } else {
    printf( ‘%3$s‘,
    esc_url( get_permalink() ),
    esc_attr( sprintf( __( ‘Permalink to: “%s”‘, ‘__x__’ ), the_title_attribute( ‘echo=0’ ) ) ),
    $thumb
    );
    }

    }

    }

    function x_custom_portfolio_lightbox_enqueue() {
    if ( ! is_admin() ) {
    if ( is_singular( ‘x-portfolio’ ) ) {
    wp_enqueue_script( ‘vendor-ilightbox-portoflio’,’/wp-content/plugins/cornerstone/assets/js/dist/site/vendor-ilightbox.min.js?ver=1.2.4assets/js/dist/site/vendor-ilightbox.min.js’, array( ‘jquery’ ) );
    }}
    }

    add_action( ‘wp_enqueue_scripts’, ‘x_custom_portfolio_lightbox_enqueue’ );

    After the latest update the lightbox doesnt work any longer. The images get full page big, but not in the lightbox format:
    http://wildlotusart.com/portfolio-item/summer-grass/

    Could you help? I was hoping that adding those functions to child theme will prevent them from changing with every update. Is there something I’m missing?
    thank you

    #1081374
    Paul R
    Moderator

    Hi,

    Please change this line of code

    
    wp_enqueue_script( 'vendor-ilightbox-portoflio','/wp-content/plugins/cornerstone/assets/js/dist/site/vendor-ilightbox.min.js?ver=1.2.4assets/js/dist/site/vendor-ilightbox.min.js', array( 'jquery' ) );
    

    to this

    
    wp_enqueue_script( 'vendor-ilightbox-portoflio','/wp-content/plugins/cornerstone/assets/dist/js/site/vendor-ilightbox.min.js?ver=1.2.4assets/js/dist/site/vendor-ilightbox.min.js', array( 'jquery' ) );
    

    Hope that helps.

    #1081398
    tashitendrel
    Participant

    Yes, it helps, thank you!

    #1081407
    Darshana
    Moderator

    Glad we were able to help 🙂

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