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.
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
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.