Your account expired support, please renew to get your support.

Home Forums Themes Support Circle Translated footer but its gone

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7922
    kristapszs
    Support Expired

    Hi. I translated the footer block with WPML but it is not showing in the translated language. No footer instead. Am i doing something wrong?

    #7925
    kristapszs
    Support Expired
    This reply has been marked as private.
    #7931

    Hi,
    About your question we can answer as below:
    1. Your admin site still can’t login. If your server blocked somethings please check it.
    2. You can use Free plugin Polylang with tutorial here:

    How to use Multi language in WordPress with Polylang plugin


    3. If you use WPML you You need customize code in 2 files: (xxx is name of theme)
    wp-content/themes/xxx/templates/footer/footer.php
    wp-content/themes/xxx/templates/footer/footer-stylesheet.php

    The new code in footer.php

    $footer_id = get_post_meta( get_the_ID(), 'haru_'.'footer', true );
    if ( $footer_id == '' ) {
    $footer_id = haru_get_option('haru_footer');
    }
    
    $footer_translate_id = apply_filters( 'wpml_object_id', $footer_id, 'haru_footer' );
    
    $content_post = get_post($footer_translate_id);
    $content = $content_post->post_content;
    $content = apply_filters( 'the_content', $content );
    $content = str_replace( ']]>', ']]>', $content );
    
    $footer_layout = get_post_meta( get_the_ID(), 'haru_'.'footer_layout', true );
    if ( ($footer_layout == '') || ($footer_layout == '-1') ) {
    $footer_layout = haru_get_option('footer_layout');
    }
    
    if ( $footer_layout != 'full' ) : ?>
    <div class="<?php echo esc_attr($footer_layout); ?> clearfix">
    <?php endif; ?>
    <?php echo $content; ?>
    <?php if ( $footer_layout != 'full' ) : ?>
    </div>
    <?php endif; ?>

    The new code in footer-stylesheet.php

    if ( post_type_exists('haru_footer') && get_posts('post_type=haru_footer') ) { // Use this only when have footer post type
    $footer_id = get_post_meta( get_the_ID(), 'haru_' . 'footer', true );
    if ( $footer_id == '' ) {
    $footer_id = haru_get_option('haru_footer');
    }
    
    $footer_translate_id = apply_filters( 'wpml_object_id', $footer_id, 'haru_footer' );
    
    $content_post = get_post($footer_translate_id);
    $content = $content_post->post_content;
    
    if ( $footer_translate_id && (get_the_ID() !== $footer_translate_id) ) {
    $shortcodes_custom_css = get_post_meta( $footer_translate_id, '_wpb_shortcodes_custom_css', true );
    if ( !empty( $shortcodes_custom_css ) ) {
    $shortcodes_custom_css = strip_tags( $shortcodes_custom_css );
    echo '<style type="text/css" data-type="vc_shortcodes-custom-css">';
    echo wp_kses_post( $shortcodes_custom_css );
    echo '</style>';
    }
    }
    }

    Reference here:

    wpml_object_id


    https://wpml.org/forums/topic/get-translated-post-id/
    Hope this helps!

    ****
    Regards,
    HaruTheme

    • This reply was modified 4 months, 2 weeks ago by admin.
    #7944
    kristapszs
    Support Expired

    Hi, thanks for suggestion but i get “Call to undefined function pll_current_language() ” error .

    FYI, link https://latvijasfilma.lv/ should work, i think there is issue with htaccess www and HTTP version of website.

    #7946

    We removed the line caused the error.
    You can check the code above again.
    In this case please remove all block in your server, then we can easy help you check the issues.

    ****
    Regards,
    HaruTheme

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

You must be logged in to reply to this topic.