Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #597674

    Hi,

    I’m using WPML for multiple languages on my site. The default language (dutch) works fine with the masonry portrait and landscape tags but english doesnt work at all.
    This is because the tags get translated. Is there a way to disable that or a workaround?

    Thanks in advance

    #599411

    Hi Rhodo!

    Thank you for using Enfold.

    Please add this in the functions.php file:

    add_filter('avf_ratio_check_by_tag_values', 'avf_ratio_check_by_tag_values_mod', 10, 1);
    function avf_ratio_check_by_tag_values_mod($tags) {
        $lang = ICL_LANGUAGE_CODE;
    	if($lang == 'de') $tags = array('portrait' => 'tagslughere', 'landscape' => 'tagslughere');
        return $tags;
    }

    Set the slug of the german tag as portrait and landscape value.

    Regards,
    Ismael

    #599584

    Hi Ismael,

    Thanks! Now the tags for the english part of the website are working but they stopped working on the dutch part.
    Should i add this code for each language?

    #600188

    Hi!

    My bad. I thought that the dutch part is not working. Please post the login details here. We would like to check the settings.

    Best regards,
    Ismael

    #602564

    Hi,

    Here’s an admin login.

    Thx in advance!

    #603535

    Hi!

    Thank you for the info. The site requires a htaccess authentication. Please post it as well.

    Regards,
    Ismael

    #604325

    Hi Ismael,

    The htaccess authentication login is provided by the hosting company as an extra security. It says in the description in the popup. I don’t know what it is.

    #604884

    Hey!

    The authentication details are not included in the popup. Please ask your hosting provider or post the .htpasswd code on pastebin.com.

    Cheers!
    Ismael

    #606713

    Hi Ismael,

    The hosting company says the details DO appear in the popup.
    But i will provide them aswell just in case ;-)

    #606937

    Hi!

    I’m sorry but it doesn’t show in the popup. You can check it yourself. We modified the code in the functions.php file:

    add_filter('avf_ratio_check_by_tag_values', 'avf_ratio_check_by_tag_values_mod', 10, 1);
    function avf_ratio_check_by_tag_values_mod($tags) {
        $lang = ICL_LANGUAGE_CODE;
    	if($lang == 'en') $tags = array('portrait' => 'portrait-en', 'landscape' => 'landscape-en');
        return $tags;
    }

    Regards,
    Ismael

    #625097

    Hi Ismael,

    Thanks for the reply.

    The landscape and portrait tags still dont work for both languages. The code you added just works for either dutch or english and automatically disables it for the other. So should i conclude that it’s not possible to have the masonry working with the tags and multilanguage?

    Hope there is still a solution somehow…

    #628746

    Hi,

    Did you see the value in the part of the suggested code?

    if($lang == 'en') $tags = array('portrait' => 'portrait-en', 'landscape' => 'landscape-en');
    

    Did you you use ‘portrait-en’ and ‘landscape-en’ for the english language?

    Best regards,
    Ismael

    #628856

    Hi Ismael,

    Thanks but the problem is as soon as i add that code the masonry portfolio and landscape tags for dutch stop working.

    I tried to add this:
    if($lang = 'nl') $tags = array('portrait' => 'portrait', 'landscape' => 'landscape');

    so the complete code is:

    add_filter('avf_ratio_check_by_tag_values', 'avf_ratio_check_by_tag_values_mod', 10, 1);
    function avf_ratio_check_by_tag_values_mod($tags) {
        $lang = ICL_LANGUAGE_CODE;
    	if($lang = 'en') $tags = array('portrait' => 'portrait-en', 'landscape' => 'landscape-en');
    	if($lang = 'nl') $tags = array('portrait' => 'portrait', 'landscape' => 'landscape');
        return $tags;
    }

    But then still only dutch works and english doesn’t!

    Is there no way this can be fixed? It’s been a couple of weeks now and it still does not work. Would be nice if there is some sort of fix.

    #629739

    Hi!

    The equal operator is incorrect. My bad. It’s working now:

    Best regards,
    Ismael

    #756588

    Hi Ismael,
    Masonry landscape and portrait not working in Multilanguage site.
    The embedded code you place here: https://kriesi.at/support/topic/masonry-landscape-and-portrait-not-working-in-multilanguage-site/ is disappeared, I also heave a problem with my English en German version that the landscape and portrait tags are not working in the masonry?

    Could you give me the code to fix this?

    Thanks Sabrina.

    #757478

    Hi Sabrina,

    You posted that you got the problem solved in this thread: https://kriesi.at/support/topic/masonry-landscape-and-portrait-not-working-in-multilanguage-site-2/#post-756589, is that correct?

    Best regards,
    Rikard

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.