Skip Navigation

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 1 voice and has 0 replies.

>
Author Posts
November 15, 2023 at 6:55 pm #14819889

luisS-26

I am trying to: Since the last update of WordPress, WPML stopped showing the English translation of this page (and the same for blumojacar.com). It has the code added to a hook via Astra Advanced Hook. It shows different ACF fields depending on the language with those if statements:

<section>
	
			<?php 

			// check for rows (parent repeater)
			if( have_rows('carta') ): ?>
				<div id="carta">
				<?php 

				// loop through rows (parent repeater)
				while( have_rows('carta') ): the_row(); ?>
					<div class="bloque-seccion">
						<h3 class="nombre-seccion">
							<?php
								if (ICL_LANGUAGE_CODE == "en") {
										the_sub_field('section');; 
								} else {
										the_sub_field('seccion');;
								}
							?>
						</h3>
						<?php 

						// check for rows (sub repeater)
						if( have_rows('platos') ): ?>
							<ul class="platos-seccion">
							<?php 

							// loop through rows (sub repeater)
							while( have_rows('platos') ): the_row();

								// display each item as a list - with a class of completed ( if completed )
								?>
								<li><span class="nombre-plato"> <?php 
									
									
								if (ICL_LANGUAGE_CODE == "en") {
										the_sub_field('name');; 
								} else {
										the_sub_field('nombre');;
								}
									
									
									
									?></span><span class="precio-plato"> <?php the_sub_field('precio'); echo '€';?></span></li>
							<?php endwhile; ?>
							</ul>
						<?php endif; //if( get_sub_field('items') ): ?>
					</div>
				<?php endwhile; // while( has_sub_field('carta') ): ?>
				</div>
			<?php endif; // if( get_field('carta') ): ?>
			<div class="contenedor-alergenos">
				<?php if (ICL_LANGUAGE_CODE == "en"): ?>
					<a class="link-alergenos" href="<em><u>hidden link</u></em>">Allergen information</a>
				<?php else: ?>
					<a class="link-alergenos" href="<em><u>hidden link</u></em>">Información sobre alérgenos</a>
				<?php endif ?>
			</div>
		</section>


Link to a page where the issue can be seen:
hidden link
hidden link
hidden link
hidden link

I expected to see: The same it has been working for years, the menu with the English fields.

Instead, I got: Nothing in the English version.

November 16, 2023 at 9:27 am #14823605

luisS-26

Hi:

I've been researching by my side and it ended up being a problem of the Astra advanced hook not hooking the info correctly, nothing to do with WPML. I made it in php straight in the child them and worked nicely.

Thanks a lot anyway for the help.

Regards