Home Forums WoodMart support forum ownl gallery showing “undefined” img title

ownl gallery showing “undefined” img title

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #359509

    key5
    Participant

    Hello
    owl gallery thumbnails showing “undefined” in code TITLE if thumbnail does not have title defined in media. Which is somewhat normal but It would be better showing empty string or showing product title as the “

    Is it possible without cloning the product-image.php template?

    Going ahead:
    I cloned that file and could only change behaviour for the first thumbnail. Not the others.

    			$thumbnail_title = get_post_field( 'post_title', $post_thumbnail_id );
                $thumbnail_caption = get_post_field( 'post_excerpt', $post_thumbnail_id );
                if(empty($thumbnail_title) || $thumbnail_title == 'undefined'){
                    $thumbnail_title = get_post_field( 'post_title', $product->get_id() );
                }
                if(empty($thumbnail_caption)){
                    $thumbnail_caption = get_post_field( 'post_excerpt', $product->get_id() );
                }        
                if(empty($thumbnail_caption)){
                    $thumbnail_caption = $thumbnail_title;
                }                        
    
    			$attributes = array(
    				'title'                   => $thumbnail_title,
    				'data-caption'            => $thumbnail_caption,
    				'data-src'                => isset( $full_size_image[0] ) ? $full_size_image[0] : '',
    				'data-large_image'        => isset( $full_size_image[0] ) ? $full_size_image[0] : '',
    				'data-large_image_width'  => isset( $full_size_image[1] ) ? $full_size_image[1] : '',
    				'data-large_image_height' => isset( $full_size_image[2] ) ? $full_size_image[2] : '',
    				'class'                   => apply_filters( 'woodmart_single_product_gallery_image_class', 'wp-post-image' ),
    			);

    Steps to reproduce behaviour
    1. go here: https://collantlover.it/collant/collant-effetto-autoreggenti-e-slip-art-301/
    2. place mouse over first and other thumbnails.

    Attachments:
    You must be logged in to view attached files.
    #359534

    key5
    Participant

    ok, I cloned product-thumbnails.php as well.

    #359613

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin and FTP access so we can check it? Also, switch to the parent theme temporarily.

    Thank you in advance

    #362778

    key5
    Participant

    Hi I solved by using custom template part.

    #362875

    Artem Temos
    Keymaster

    We are glad that you sorted it out. Let me know if you need any further assistance.

    Have a nice day!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘ownl gallery showing “undefined” img title’ is closed to new replies.