I am developing a site for myself and decided to test the free Polylang plugin with the aim of purchasing it further, if everything suits me. Before that I used qTranslate-X. Polylang is very convenient and perfectly translates website pages and much more, including custom strings (which the plugin found automatically).
Problem: I cannot translate the link that was created in the Basel theme header builder. The theme developers are referring to you to solve this problem.
The link has the following code: <ul class = "inline-list inline-list-with-border main-nav-style"> <li> <a class="color-primary" href="#"> PACKAGE TRACKING </ a > </li> </ul>
What I was trying to do:
1. Written in the theme’s functions.php: pll_register_string ('find', '<ul class = "inline-list inline-list-with-border main-nav-style"> <li> <a class = "color-primary" href = "#"> PACKAGE TRACKING </a> </li> </ul> ');
Next, I translated this custom string into the languages ??I need in the plugin’s admin panel. Next, I wrote the theme header builder into the editor: <?php pll_e ('<ul class = "inline-list inline-list-with-border main-nav-style"> <li> <a class="color-primary" href="#"> PACKAGE TRACKING </a> </li> </ul> '); ?>
Nothing succeeded.
2. I continued looking for a solution. I could not find a theme template that would be responsible for the header builder and displaying it on the site pages. But I found entries about the link I created in phpMyAdmin in the vp_postmeta table. I supplemented the line entry with the pll_e expression. This also did not lead to success.
3. I was trying to create a string in the wp_icl_strings table by analogy with the auto-found custom strings in the plugin. It didn’t help either.
Perhaps I am doing something wrong. Please help me figure it out. What qTranslate-X was VERY CONVENIENT was that it was possible to use multilingual fields, for example: [: en] English Text [: xx] Other language Text [:]. Unfortunately, there is no such thing in Polylang.
My link consists of divs, here is the complete structure:
<div class = "whb-column whb-col-right whb-visible-lg">
<div class = "whb-text-element reset-mb-10"> <ul class = "inline-list inline-list-with-border main-nav-style">
<li> <a class="color-primary" href="#"> PACKAGE TRACKING </a> </li> </div>
</div>
]]>pll_e
or pll__
commands one after the other with two different translation strings I’ve correctly setup in my functions.php (and are both showing up in the Strings Translations section of my WP dashboard) and one works, but the other doesn’t. The one that’s not working just spits out whatever I’m placing between the quotations marks in my pll_e
or pll__
command, i.e. if I write pll_e( 'stringname' );
, it will echo stringname.
The reason I’m placing them side by side is to test them out. Because the two instances that don’t work, seem not to work throughout the site!
I’ve tried everything and can’t figure out why.
All my custom strings are correctly registered in my functions.php using this format:
pll_register_string( 'stringname', 'stringcontent' );
I’ve checked and rechecked; and in fact all of them are appearing correctly in the Strings Translations sections, as I mentioned.
It’s when I try to use them that only some of them work. And it doesn’t even have to do with the location of the pll_e
or pll__
commands, as I’ve tried placing them all over the place to no avail…
https://www.ads-software.com/plugins/polylang/
]]>How can i translate the informations in my footer ?
this is html i have written in mytheme/footer.php
Thanks a lot for your help
https://www.ads-software.com/plugins/polylang/
]]>I show the string in “Strings Translation”
I put this in my footer.php file to echo the string:
<p id="footer-info"><?php pll_e($footer-text, MyTheme); ?></p>
In the footer it shows the number 0
https://dev.workforcesoftware.com/
Your help is appreciated:)
https://www.ads-software.com/plugins/polylang/
]]><?php $zerif_contactus_title = get_theme_mod(‘zerif_contactus_title’,’Get in touch’);
if ( !empty($zerif_contactus_title) ):
echo ‘<h2 class=”white-text”>’.$zerif_contactus_title.'</h2>’;
endif;
$zerif_contactus_subtitle = get_theme_mod(‘zerif_contactus_subtitle’);
if(isset($zerif_contactus_subtitle) && $zerif_contactus_subtitle != “”):
echo ‘<h6 class=”white-text”>’.$zerif_contactus_subtitle.'</h6>’;
endif;
?>
</div>
I create a translation string with pll_register_string for zerif_contactus_title in functions.php of theme, but when I add pll_e to echo codex the $zerif_contactus_title seems doesn’t work.
This is the function:
pll_register_string(‘contacts’, ‘$zerif_contactus_title’, ‘zerif-lite’);
Any ideas?
]]>I’ve a problem:
– I load via AJAX a group of posts when “load more posts” button is pressed.
The function defined on functions.php to handle the ajax request, returns an HTML block with the fresh loaded posts. This HTML is basically the same that appears on my index.php, on my theme. So posts loaded on index.php and the ones returned via functions.php have the very same structure and code.
Problem is:
– On index.php, functions from polylang work properly. But in functions.php, they don’t.
I’m still having my registred words in english instead of spanish.
Why is that?
Thanks.
PS: fact is, that in functions.php I’ve some defined filters (like one to short the excerpt words number to 15 words) and they doesn’t work at all too. What is going on?
https://www.ads-software.com/extend/plugins/polylang/
]]>