• Resolved chris1354

    (@chris1354)


    Hi,
    I have a problem with qTranslate. The title of each page is displayed in English and German. For example a title of one page is “About us”, but you can see “About usüber uns”

    I tried <!–:de–>über uns<!–:–><!–:en–>About us<!–:–>
    and [:de]über uns[:en]About us

    I think it depends on the theme but I don′t know how to fix it.
    https://www.futubox-reseller.com

Viewing 15 replies - 1 through 15 (of 22 total)
  • Anjara

    (@hiteshanjara)

    Hey,

    You need to use “qtrans_use” function to display the post title as per current language.

    You can use the following code to display correct post title –

    <?php echo qtrans_use($q_config['language'], $post->post_title, true);?>

    Example link – https://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=2

    Hope this will help you!

    Thread Starter chris1354

    (@chris1354)

    Hi,
    Yes that helped me a lot. Thank you very much.

    Anjara

    (@hiteshanjara)

    Yo welcome ??

    <?php echo qtrans_use($q_config['language'], $post->post_title, true);?>

    If I want to call the meta title post, from the “Qtranslate meta”, how can I do ?
    thanks to help me

    Anjara

    (@hiteshanjara)

    I think you can try this:

    First of all, get the meta data in to separate variable:

    $post_meta = get_post_meta($post->ID, 'meta_key', true)

    and then, you can translate it as we did:

    <?php echo qtrans_use($q_config['language'], $post_meta, true);?>

    Hope this will help you!

    Ok ! perfect, I try it.
    Thanks a lot !

    @Huteshanjara: Please i read your great solution, but i don’t have any ideas where place the code. My site (under construction) are https://www.boscaro.info and theme directory are boscaro2 . If you have a bit of time for me you are wellcome!

    Thanks in advance.

    Anjara

    (@hiteshanjara)

    okay, how can i contact you?

    Can I contact you from your site: https://www.boscaro.info/en/contatti/

    let me know that what will be best to discuss it.

    Hitesh Anjara

    Hello
    I am having the same problem let me know in which file we have to change.

    thanks

    hi hiteshanjara,
    i am new to wordpress as well as qTranslate. i read your solution for translating the post title, but still i dont know where do i need to add those code. Can you please help me. Thanks in advance

    Anjara

    (@hiteshanjara)

    Hi, can u plz give your installed wordpress version?

    hi hiteshanjara,

    i am using wordpress version 3.5.1

    Anjara

    (@hiteshanjara)

    Okay

    You just need to find the “content-page.php” in your theme folder.

    For. E.g: “/wp-content/themes/YOUR_THEME_FOLDER/content-page.php”

    In this file, you can find the_title(); replace this code with:

    global $post;
    echo qtrans_use($q_config['language'], $post->post_title, true);

    as per my above comments.

    I hope this will work in your theme, let me know if you will face any issue on the same.

    dude thanks a lot for your help.now i have added the code to the wp-content/themes/YOUR_THEME_FOLDER/content-page.php .but my doubt is if we add new posts or page,in the admin view of wordpress the every new page or posts title should be shown in the laguages which i have included na…(i included simplified chinese,traditional chinese,english)

    pleas check the image below
    https://prntscr.com/14d9uj

    (in that image you could find that title for traditional and simplified chinese is null)

    Anjara

    (@hiteshanjara)

    ?? You should need to enter the translated text there.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Plugin: qTranslate] Page Title’ is closed to new replies.