Skip Navigation

[Resolved] Images won't show up inside vc galleries in other language

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Minesh 5 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1368505

Hi there,

Shane helped us to have images show up inside vc galleries.
Link to the support page where he did:
https://toolset.com/forums/topic/image-ids-inside-vc_gallery/

This worked excellent but since we've chosen to use the wpml setup 'Language URL format - A different domain per language' the images only show up in the native/default language of the wp installation.
(we use .eu domain to point EN (default) and a .nl domain to point dutch).

A page with images (default language): hidden link
A page without images (NL translation: hidden link

When I check the html of the NL translation, there is no image loaded as well...
(the featured image is loaded with this wpml setup - the issue happens in the script Shane helped us to setup).

Is there something we're missing?
Is it possible the images are not loaded because the browser thinks it's coming from another domain?
Or is it possible to make the images relative?

It might be a WPML issue as well, hope Toolset can help us to make it work...

Thanks,

Paul

#1368527

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Actually - the code Shane shared looks correct but the issue is happened after you installed the WPML and made changes accordingly.

I would like to know - you want to display the same images which is displayed with default language?
Have you translated your media?

Can you please share wp-admin access details so I can check what's going wrong there?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1368745

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately - SFTP access details not working at this end and I do not have rights to edit the custom code added at "Custom Code" section offered by Toolset where Shane added the code.

I need a way to access that code - can you please grant me the rights so I can proceed further.

#1368751
Schermafbeelding 2019-10-24 om 12.48.30.png

Hi Minesh, can you try ftp (instead of sftp)?

I use filezilla and tested which works fine.
Only use the IP with name and password and no // behind it.

#1368899

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've modified the shortcode as given under:

// Add Shortcode
function get_repeatable_image_ids( $atts ) { 
    // Attributes
    $atts = shortcode_atts(
        array(
            'field' => '',
            'id' => ''
        ),
        $atts
    );
	
	 
    
	$image_urls = get_post_meta($atts['id'],$atts['field']);

 
	 global $wpdb;
	
    
    $id_list = array();
    foreach ($image_urls as $image_url) {
        if(!empty($image_url)){
			     $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url)); 
                 array_push($id_list, $attachment[0]);
				 
	 
	 
             }
        }
		
     $gallery_ids = implode(",", $id_list); 
	 
	
	 
	 
 return do_shortcode("[vc_gallery el_id='gallery-grid' medias='".$gallery_ids."'  explode_albums='yes' gutter_size='1' screen_lg='1000' screen_md='600' screen_sm='480' single_overlay_opacity='50' images_size='three-two' lbox_skin='white' single_padding='2']");
  
}
add_shortcode( 'get_repeatable_image_ids', 'get_repeatable_image_ids' );

I can see now images are displayed on NL language as well: hidden link

#1368933

Hi Minesh,

Thats really great!! Thanks.
Can you tell me what was the adjustment / difference in the old vs new code?
We have another site with this issue, so I can make the changes there myself...

Thank you for your fast assistance...

Kind regards,
Paul

#1368963

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To avoid such code replacement error you can simply delete the old shortcode and add the code I shared.