Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Does catch kathmandu support multilingual? #47298
    stijnh
    Member

    forgot: the original catchkathmandu_post_sliders() is in wp-content/themes/catch-kathmandu/inc/catchkathmandu-functions.php

    in reply to: Does catch kathmandu support multilingual? #47295
    stijnh
    Member

    @sakin: Catch Kathmandu Pro + WPML is probably a solution, but not a cheap one as you need to buy a License for both the Catch Kathmandu theme AND the WMPL plugin.

    @helenafjellgren: I found what the problem was, but the problem situates in the php code of the Catch Kathmandu theme. The code is valid, but not compatible with the polylang plugin. You can easily create a workaround though.

    When you are using posts in the slider header, Catch Kathmandu will call the following function to generate the slider:

    catchkathmandu_post_sliders()

    That function will generate a slider based on the post that you have configured in Theme options. It even uses the correct translated version of the post. However, after the slider is generated, it is cached in WordPress for 24 hours. Therefore, when you switch language, or another visitor arrives at your site in another language, the post will still be in the language of the original request.

    The simpliest solution would be to disable caching for this slider.

    The answer for that is in the first line of this function, which is commented:
    //delete_transient( ‘catchkathmandu_post_sliders’ );

    change this to
    delete_transient( ‘catchkathmandu_post_sliders’ );

    and the cache will be removed when the function starts execution.

    Of course, it is better to create a child theme, and copy the original function into the functions.php, and make your modifications there. That way, if the Catch Kathmandu theme is updated, your modifications won’t be lost.

    This is a quick solution with minimal changes, but it does disables the caching for the slider, and you could lose performance.

Viewing 2 posts - 1 through 2 (of 2 total)