Polylang and Home Page

Home Forums SKT Full Width Forum Polylang and Home Page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #12511
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    Greetings,

    I am using Polylang plugin to build English and French. The progress is going relatively well for all pages except for the Home page. I do not understand how to edit the Home page in one language so that it only shows the edit on that language’s home page eg.: Fr [mysite.com/index.php/fr/] and En [mysite.com/index.php/en/]. I have two sections and a footer. In Section 1, there is text on the slider images, including the contact us button. in Section 2, I have the “accordion” menu. Then the footer. I have tried a few different things, but whenever I edit any content on the home page it is reflected the same way on both En and Fr.

    Just going around in circle Please help – Thank you,

    #12517
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Hi,

    Kindly use qTranslate X plugin. The use of this plugin and how to do multilingual for homepage has been explained here: http://sktthemesdemo.net/documentation/bony-doc/

    Click on Multilingual tab on the above link.

    The rest pages/posts etc automatically show different language tabs for ease of use.

    Regards,
    Shri

    #12545
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    Hi,

    Not such a practical solution considering the only thing left for me to translate is the Home page……

    #12582
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Kindly use this function:

    function polylang_shortcode($atts, $content = null){
    	if (empty($content))
    		return '';
    	extract( shortcode_atts( array('lang' => ''), $atts ) );
    	if (empty($lang))
    		return "<h3>You must specify 'lang' using shortcode: polylang</h3>";
    
    	return ($lang == pll_current_language()) ? $content : '';
    }
    add_shortcode('polylang', 'polylang_shortcode');
    #12583
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    And then go to the theme options area of homepage and slider and use this:

    [polylang lang=”en”]English[/polylang][polylang lang=”es”]Spanish[/polylang]

    Languages i used are for example use your actual language codes and languages.

    Regards,
    Shri

    #12604
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    Thanks Shri,

    I am assuming I use the Editor to input the text but with page/template do I apply it to?

    Thanks again

    #12631
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Hi,

    Kindly paste this at very end of functions.php

    Regards,
    Shri

    #12857
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    I’m still having difficulty with this:

    I pasted in functions.php exactly the code section that you provided in your reply to my post #12582.

    Then in the slider image 1, used exactly the following code:

    [polylang lang=”en”]SERVICES OFFERED IN CANADA AND GLOBALLY[/polylang][polylang lang=”fr”]SERVICES OFFERTS AU CANADA ET MONDIALEMENT[/polylang]

    On the front end for slider image 1 the code line above comes as text exactly as is, i.e the function is not executed, it just shows as text.

    In both cases I have saved/updated the changes and of course refreshed the front end to test.

    What I am doing wrong (my languages are En/Fr)

    Thank you

    #12912
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Not sure if the function even works.

    Send us the url of the site and WordPress admin details via email: [email protected]

    qTranslate works out of the box with our themes but i understand that you want to use Polylang.

    Regards,
    Shri

    #13268
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    Shri,

    I sent you on Octy 19 the admin details as requested. I am not very pleased with your service. First you give me a code, I follow your instruction and it does not work, then you tell me your not sure if the function even works; If so why would you provide something that might not work. You indicate that qTranslate works out of the box, however I have completely finished (as mentioned before) the site and only need to use the translating function for the home page.

    Please action

    #13299
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Sent back reply to your email.

    Regards,
    Shri

    #13489
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    Resent admin details as requested.

    And received email that programers were working on issue, never received problem fix email or further correspondence with instruction. Saw on the site that site titled had been changed on home page slider also saw that this code had been added to first home page slider dialogue box:

    <span lang=”en-US”>SERVICES OFFERED IN CANADA AND GLOBALLY</span> – <span lang=”fr-FR”>SERVICES OFFERTS AU CANADA ET MONDIALEMENT</span>

    Where the Capital text is my content. However the code still does not work.

    I have wasted a tremendous amount of time with this issue and still it does not work.

    Please address and fix.

    Not happy…

    #13495
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Really sorry for this. We tried to contact plugin developer he said only if you include php translations which he suggests which doesn’t work with any other plugin nor the core WordPress translation functions then it would be possible.

    In latest 2 versions of his plugin he even stopped use of any shortcodes.

    We tried all possible solutions. Since your site isn’t that big enough can you not use qTranslate X? It works out of the box and doesn’t require any coding changes as well.

    Regards,
    Shri

    #13557
    rene sheirrene sheir
    Member
    • Topics: 4
    • Replies: 10
    • Total: 14
    Member since: September 7, 2015

    k will do thks

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.