• Okay so this is odd, I’m using Ajax Load More in conjunction with WPML.

    In my page template I have set the following code:

    `<?php if ( ICL_LANGUAGE_CODE==’en’ ) : ?>
    <?php echo do_shortcode(‘[ajax_load_more container_type=”ul” post_type=”post” custom_args=”lang:en” category=”teen-health” posts_per_page=”4″ repeater=”template_1″ scroll=”true” scroll_distance=”160″ transition=”fade” orderby=”date” order=”DSC”]’); ?>
    <?php elseif ( ICL_LANGUAGE_CODE==’fr’ ) : ?>
    <?php echo do_shortcode(‘[ajax_load_more container_type=”ul” post_type=”post” custom_args=”lang:fr” category=”sante-des-ados” posts_per_page=”4″ repeater=”template_1″ scroll=”true” scroll_distance=”160″ transition=”fade” orderby=”date” order=”DSC”]’); ?>
    <?php endif; ?>`

    This works, but I’m getting a bug where sometimes the wrong language is displayed when using the language switcher, it seemingly doesn’t happen when I just refresh the current page. It doesn’t always happen, and seems to happen more when viewing in a private browser. There is no caching plugins installed and no server level caching as well, I also installed rebusted but that doesn’t help.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mtlsam

    (@mtlsam)

    Following up on this for support please. I’m not sure why the code pasted in an ugly manner the first time, so here is a second attempt, it’s the exact same code.

    <?php if ( ICL_LANGUAGE_CODE==’en’ ) : ?>
    <?php echo do_shortcode(‘[ajax_load_more container_type=”ul” post_type=”post” custom_args=”lang:en” category=”teen-health” posts_per_page=”4″ repeater=”template_1″ scroll=”true” scroll_distance=”160″ transition=”fade” orderby=”date” order=”DSC”]’); ?>
    <?php elseif ( ICL_LANGUAGE_CODE==’fr’ ) : ?>
    <?php echo do_shortcode(‘[ajax_load_more container_type=”ul” post_type=”post” custom_args=”lang:fr” category=”sante-des-ados” posts_per_page=”4″ repeater=”template_1″ scroll=”true” scroll_distance=”160″ transition=”fade” orderby=”date” order=”DSC”]’); ?>
    <?php endif; ?>
    Plugin Author Darren Cooney

    (@dcooney)

    @mtlsam I need to find time to set up WPML and run some tests.
    I’m not sure what the problem would be off the top of my head.

    Thread Starter mtlsam

    (@mtlsam)

    Thanks! I’ll await your investigation.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Loads wrong language.. sometimes?’ is closed to new replies.