This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Yvette 1 year ago.

Assigned support staff: Yvette.

Author Posts
October 9, 2018 at 5:16 pm

olivierb-42

Hi,

I created a custom field to add a lightbox gallery under every products. I am using ACF.

I have been able to display the gallery using this code:


<?php
  	$images = get_field( 'lightbox_gallery' );
  	if( $images ): ?>
	  	<?php foreach( $images as $image ): ?>
		<?php $image_large = wp_get_attachment_image_src($image['id'], 'large'); ?>
		<?php $image_medium = wp_get_attachment_image_src($image['id'], 'medium'); ?>
	        <div style="padding-right: 7.5px; padding-left: 7.5px;" class="col-md-6">	<a href="<?php echo $image_large[0]; ?>" rel="lightbox[gallery]">
	            <img style="padding-bottom: 15px;" src="<?php echo $image_large[0] ; ?>" />
	        </a></div>
		<?php endforeach; ?>
	<?php endif; ?>

The problem is that it work on live version, I tried to reproduce in staging and it dosen't work.

The gallery does not display in french version. It seems that it can't find the image id.

I've set the custom field to Copy the content from english to french. The images show in the backend in french but i get an error on front-end

October 10, 2018 at 9:31 am #2803667

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

Before I start troublshooting, can you provide more info:

1. Are your staging and live sites identical in software versions installed?
e.g. Wodpress, Plguins and Theme

2. Are your staging and live sties hosted on same server?

3. Is the Duplicator package you provided from your staging site or live site?

4. What are the primary differences between the two environments?

4. If it is working on live site but not on staging, how did you create the staging site?

In general, if all things are equal, the problem might be related to the server settings or the way the database was migrated.

Thanks

October 10, 2018 at 2:25 pm #2804760

olivierb-42

Hello,

1. Yes, event while deactivating all pluginsexcepted ACF and WPML, it still dosent work.
2. Yes
3. Yes
4. Staging does not have cache enabled
5. To create the staging site, I reinstalled everything and imported data from live.

October 11, 2018 at 8:55 am #2807236

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thanks for that information - it helped.

You did not complete the ACF configuration for multilingual custom fields as described here:
hidden link

For this reason, you were receiving the notice. I did the following steps:
- Mark post type "Field group" as "Translate"
- Duplicate/Translate independently the field group "lightbox_gallery" to FR
- Then I set the related custom fields to "copy" : lightbox_gallery, _lightbox_gallery
- I then updated the EN product

Now the FR product is showing the lightbox gallery.
I can see that the video is not showing in the FR product. If you cannot resolve this, please open a new ticket and include information about how this video url is being configured.

However, with regards to the offset-id warning, I believe the issue is resolved.

October 11, 2018 at 4:04 pm #2809070

olivierb-42

Great!

1) May I know where do i go to Enable field group translation it is written that the option for “Fields” has been hidden in recent versions of ACF

2) Just so that I understand better, why does it work on Live, i didn't duplicated the lightbox fields for french. It just copied the field in both language.

3) It work for the video, I just the the process in what you mentioned above. But I feel that it was a cache issue with the video field, now i have to recreate all the other field using your method mentioned. Is there a way to delete all the old fields they still show up in wpml - settings - system fields

October 12, 2018 at 11:53 am #2811802

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

1) Field group v. Fields
Yes, the post type "Fields" is now hidden. However, you still need to set the post type "Field group" to "translate". (see image)

2) LIve v. Staging
I am not able to answer that 100%. Perhaps it was sufficient to only have the "Field group" post type marked as "Translate".

However, I followed the whole documentation as written which included creating the translated fields within the field group.

3) Deleting custom fields
Is there a way to delete all the old fields they still show up in wpml - settings - system fields.
These are settings in the database. I would just ignore them instead of delete them as you would then have to actually go into the database to delete them.

If you need to do this, please open a new ticket and include the list of custom fields you want to remove.