Okay
  Print

How to translate the dynamic strings in Advertisement Area and Home Slogan Area Settings with Polylang?

1. Please add the codes below into functions.php in wp-content\themes\ultimate-conversion.

Then change (This is a translated string.) text in quotation mark to the text what you write. Don't delete the quotation marks (').

pll_register_string('Top Advertisement Bar Text', 'This is a translated string.');
pll_register_string('Top Advertisement Bar Button Text', 'This is a translated string.');
pll_register_string('Home Slogan Area Big Heading', 'This is a translated string.');
pll_register_string('Home Slogan Area Text', 'This is a translated string.');
pll_register_string('Home Slogan Area Button Text', 'This is a translated string.');

2. Please change the codes on line 721 in functions.php in wp-content\themes\ultimate-conversion.

 echo '<div class="advertisement-topbar"><a class="advertisement-close-btn" href="#"><i class="fa fa-times"></i></a><div class="container">'.
   '<h3>'.wp_kses(get_theme_mod("ultimate_conversion_adver_topbar_text"), wp_kses_allowed_html( 'post' )).'</h3>'.
   '<a href="'.esc_url(get_theme_mod("ultimate_conversion_adver_topbar_button_link")).'" class="btn type-1">'.
   wp_kses(get_theme_mod("ultimate_conversion_adver_topbar_button_text"), wp_kses_allowed_html( 'post' )).
   '</a>'.
'</div></div>';

to these codes below.

 echo '<div class="advertisement-topbar"><a class="advertisement-close-btn" href="#"><i class="fa fa-times"></i></a><div class="container">'.
   '<h3>'.wp_kses(pll__(get_theme_mod("ultimate_conversion_adver_topbar_text")), wp_kses_allowed_html( 'post' )).'</h3>'.
   '<a href="'.esc_url(get_theme_mod("ultimate_conversion_adver_topbar_button_link")).'" class="btn type-1">'.
   wp_kses(pll__(get_theme_mod("ultimate_conversion_adver_topbar_button_text")), wp_kses_allowed_html( 'post' )).
   '</a>'.
'</div></div>';

3. Please also change the codes in home_slogan.php in \wp-content\themes\ultimate-conversion\inc\includes\

<div class="layout-title-container<?php echo esc_attr($ultimate_conversion_class_layout_text) ?>">
<div class="container">
<div class="layout-title">
<?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_image' )) : ?>
<img src="<?php echo esc_url(get_theme_mod( 'ultimate_conversion_layout_home_slogan_image' )); ?>"<?php if(get_theme_mod("ultimate_conversion_layout_home_slogan_image_width")){echo ' width="'.get_theme_mod("ultimate_conversion_layout_home_slogan_image_width").'"';} if(get_theme_mod("ultimate_conversion_layout_home_slogan_image_height")){echo ' height="'.get_theme_mod("ultimate_conversion_layout_home_slogan_image_height").'"';} ?> alt="" />
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_title' )) : ?>
<h3><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_title' ); ?></h3>
<span class="sub-title"><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_sub_title' ); ?></span>
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_text' )) : ?>
<div class="layout-text">
<p><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_text' ); ?></p>
</div>
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_text' )) : ?>
<a class="layout-link btn type-4" href="<?php echo esc_url(get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_link' )); ?>"><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_text' ) ?></a>
<?php endif; ?>
</div>
</div>
</div>

to these codes below.

<div class="layout-title-container<?php echo esc_attr($ultimate_conversion_class_layout_text) ?>">
<div class="container">
<div class="layout-title">
<?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_image' )) : ?>
<img src="<?php echo esc_url(get_theme_mod( 'ultimate_conversion_layout_home_slogan_image' )); ?>"<?php if(get_theme_mod("ultimate_conversion_layout_home_slogan_image_width")){echo ' width="'.get_theme_mod("ultimate_conversion_layout_home_slogan_image_width").'"';} if(get_theme_mod("ultimate_conversion_layout_home_slogan_image_height")){echo ' height="'.get_theme_mod("ultimate_conversion_layout_home_slogan_image_height").'"';} ?> alt="" />
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_title' )) : ?>
<h3><?php echo pll__(get_theme_mod( 'ultimate_conversion_layout_home_slogan_title' )); ?></h3>
<span class="sub-title"><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_sub_title' ); ?></span>
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_text' )) : ?>
<div class="layout-text">
<p><?php echo pll__(get_theme_mod( 'ultimate_conversion_layout_home_slogan_text' )); ?></p>
</div>
<?php endif; ?> <?php if (get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_text' )) : ?>
<a class="layout-link btn type-4" href="<?php echo esc_url(get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_link' )); ?>"><?php echo get_theme_mod( 'ultimate_conversion_layout_home_slogan_button_text' ) ?></a>
<?php endif; ?>
</div>
</div>
</div>