dev.xiligroup est en travaux › Forums › xili-language plugin › calling the current language code
Taggé: conditional, filename, functions, get language, hooks, localization, php, slug, the_curlang, xili-language
Ce sujet contient 0 réponses et 2 voix, et a été mis à jour par Anonyme il y a Il y a 14 ans.
-
AuteurArticles
-
8 May 2011 at 14:04 #2906
AnonymeThanks for your question and circumstantial notes. Documentation is a hard work and now after more than three years of versioning, i know it is a goal to rewrite it totally… but the time is not yet here…
Question: is the image (filename) attached to a post or attached to a block in the theme itself? In each case a solution exists
For the question about Archive : can you open a topic and precise what you observe ?
9 May 2011 at 7:54 #2908
AnonymeThe file is in the header and I’d like to put the current language name into the filename of this block.
<h1 id="blog-title"><span><a>/<?php if(function_exists(xiliml_get_language)) echo xiliml_get_language($lang_nameorslug=""); ?>" title="<?php echo wp_specialchars( get_bloginfo('name'), 1 ) ?>" rel="home"><img src="<?php bloginfo('url'); ?>/wp-content/themes/sandbox-child-haft2know/images/haft2know_header-[NEED CURRENT LANGUAGE HERE].png" title="<?php bloginfo('name') ?> | <?php bloginfo('description') ?>"></a></span></h1>
I also tried to call xiliml_get_language as you can see, but it doesn’t return the
?lang=en_us
or fr_fr that it should when in those languages. It doesn’t return any errors! Pls. help! Thanks!Archive months are not translating:
And they return ALL posts in ALL languages.
(I’m using a child theme of the Sandbox theme.)
Thanks!
9 May 2011 at 12:14 #2909
Anonymethe function the_curlang() function normally give you ‘en_us’ or ‘fr_fr’ string… and not the full object of current language (print_r() show resulst – and not echo –
for archives :
wp_get_archives(‘..your.vars..&lang=fr_fr’)
or
wp_get_archives(‘..your.vars..&lang=’) to display current
see also https://dev.xiligroup.com/?p=1432 and naturally read the plugin code source…
9 May 2011 at 15:09 #2911
AnonymeSorry, but I don’t know how to get that to work, your documentation is hard to follow. Can you show me what I need to do to get the archive months translating with Fr_fr slugs in the URLs?
I keep going over the info online, I just can’t seem to firgure it out. I really appreciate the help!
10 May 2011 at 21:19 #2920
AnonymeThanks, sorry, I forgot to post I was successful with the the_curlang() function! It’s the difficulty I have been having with the article listing that has me stumped. I have tried replacing the usual wp_get_archives function call in the sidebar.php and nothing changed (or would show, even without archive widgets active).
Thanks for your help so far. I know I’m getting close!
-
AuteurArticles
Vous devez être connecté pour répondre à ce sujet.