-
AuthorPosts
-
June 27, 2014 at 3:27 pm #62194
Hi,
I’ve searched through the forum and others as well and I haven’t found a solution yet. I’ve even tried to alter the footer.php file in multiple ways.
I have a website and it´s in two languages. I can´t manage to translate the text in the footer content so that I can have it in two languages. Is there any way to do that?
Thanks!
June 28, 2014 at 7:45 pm #62545Hi Stefan,
Thank you for writing in!
You will have to add translation function manually at wp-footer.php
1. Copy wp-footer.php from /x/framework/views/integrity/ to /x-child-integrity-light/framework/views/integrity/
2. Edit your copied wp-footer.php and find this line of code :<?php echo get_theme_mod( 'x_footer_content' ); ?>
and change it into :
<?php echo pll__(get_theme_mod( 'x_footer_content' )); ?>
3. Add this code at your child theme’s functions.php
pll_register_string('Footer Translation', get_theme_mod( 'x_footer_content' ) , true);
4. Save and upload.
5. Go to Polylang string translation and translate it.
Hope this helps.
June 29, 2014 at 1:47 pm #62728Thank you so much for the help!
June 30, 2014 at 1:09 am #62942You’re welcome Stefan.
June 7, 2015 at 5:08 pm #295224Hi,
can you please help me to implement the solution given in this thread with the current versions of X (4.0.1) and polylang? Here is what i tried:
Since I couldn’t find “get_theme_mod” in the wp-footer.php, I figured the function has been replaced by “x_get_option”. So I modified the wp-footer.php of the child theme as suggested above, but with “x_get_option” instead of “get_theme_mod”.
I then took it from the polylang documentation that “pll_register_string” now has an additional (third) parameter. So I added the following line to the functions.php of the child theme:
pll_register_string('Footer Translation', x_get_option( 'x_footer_content' ) , 'polylang', true);
However, this breaks the whole site. I may add that I have put some HTML-code in the Footer Content (basically, <b> and a link), but I believe that this should not be a problem, or am I wrong?
Kind regards
Bernhard
June 8, 2015 at 2:09 am #295498Hello There,
Thanks for updating this thread!
get_theme_mod
is a WordPress function. You can check it here: https://codex.wordpress.org/Function_Reference/get_theme_modCan you please post the contents of your
wp-footer.php
file? Just place it using the code tag. The footer content with html tags may be one of the reason why your site is broken. We’ll be happy to provide you with a response once we have a better understanding of the situation.Please let us know.
-
AuthorPosts