• Resolved MaxStirner

    (@maxstirner)


    Hello,
    please sorry about my bad english.

    I need to translate <title> and <description> tags in my site. Actually I use a code like this with qtranslate:

    <?php if (qtrans_getLanguage() == 'en') : ?>
    <title>
    <?php if ( is_home() )     { ?>Bla Bla Bla<?php } ?>
    <?php if ( is_search() )   { ?>Bla Bla Bla<?php } ?>
    <?php if ($paged>1) { 
         echo '| Page ', $paged;
    } ?>
    </title>
    
    <?php else : ?>
    <title>
    <?php if ( is_home() )     { ?>Bla Bla Bla<?php } ?>
    <?php if ( is_search() )   { ?>Bla Bla Bla<?php } ?>
    <?php if ($paged>1) { 
         echo '| Pagina ', $paged;
    } ?>
    </title>
    <?php endif; ?>

    Unfortunately this code no longer works with WP Multilang. I tried to change something but no luck at all. There is a way to translate title and description with WP Multilang?

    Thanks in advance!

    • This topic was modified 7 years, 12 months ago by MaxStirner.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @maxstirner
    This is custom taxonomy?
    Just add taxomomy name to configs.

    If You need get current site language, You can use function ‘wpm_get_language()’.

    Thread Starter MaxStirner

    (@maxstirner)

    Hi @valexar
    Sorry I’m not a great programmer 🙂

    This is my home page. What I need is to have something like that:

    if is english <title>English HomePage</title>
    if is italian <title>Italian HomePage</title>

    I need to use this meta out of wp_head, so I have to write the code manually.

    But I don’t understand how to use WP Mltilang tags in head meta elements. [:en] and [:it] don’t work.

    Sorry again about my bad english.

    You can use function ‘wpm_translate_string’ for translating multilingual string.
    It describe in the plugin description.

    Thread Starter MaxStirner

    (@maxstirner)

    I’m sorry to bug you…

    The are some example of how compile the $string, $language part?

    
    echo wpm_translate_string('[:en]Aenean vulputate[:de]Fusce risus nisl');
    
    Thread Starter MaxStirner

    (@maxstirner)

    Thank you @valexar, I really appreciate that!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Translate the meta tag’ is closed to new replies.