Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #589631

    Hello,

    I would like to add the polylang language switcher bar on top of my “coming soon” page which is based on the blank – Template. Therefore I need to add the follwoing code at the very top, but only if the “blank”-template is used, because otherwise the bar is placed on the menu.

    Can you advice which files I do have to modify supposed that I am using an enfold child theme?

    #589805

    Hi Infinity!

    You can add Code Block element to your page and add your code inside it or text tab of text block element :)

    Regards,
    Yigit

    #590603

    Hello Yigit,
    I tried to add the follwoing code but it does not get interpreted:

    						// Language switcher
    						if (function_exists('pll_the_languages'))
    						{
    							?> <div class="my-lang"><?php pll_the_languages(array('show_flags'=>1,'show_names'=>0, 'hide_if_empty'=>1)); ?></div> <?php
    						}
    #590821

    Hey!

    Please try using a plugin such as this one – https://wordpress.org/plugins/insert-php/
    If that does not help, please elaborate on the changes you would like to make as i have a feeling that i may have not understood you correctly :)

    Cheers!
    Yigit

    #590947

    Hi,

    please have a look at my website to see that the php code is not evaluated. I activated the plugin of course and used the code element.

    What I am trying to do is to add language flags to on the very top of my website. While I already found a solution for the default theme (add the flags to the menu – see 2nd link) I can’t get it to work for the “no header no footer” theme because I have no menu where I can place the flags on to and I don’t know which files I do have to modify.

    Regards

    #592616

    Hey!

    Please try adding following code to Functions.php file in Appearance > Editor

    function avia_poly(){
            $output = pll_the_languages();
    	return $output;
    }
    add_shortcode( 'polylang_switcher', 'avia_poly' );

    and then add following shortcode into your page with blank page template

    [polylang_switcher]

    Regards,
    Yigit

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