• Resolved Krzysiek McK

    (@krzysiek-mck)


    Theme: WEN Business
    Polylang plugin version: 1.7.3.

    Hi

    First of all big thanks for creating Polylang! – it’s really great!

    I have two questions regarding the usage of the plugin on which answer I did not find on the wordpress support website.

    1. How can I place the language switcher icons in the top right corner of the site? On the polylang website I found the code

      <?php pll_the_languages();?>

    which should help but I don’t know how to code so I don’t know where to place it…

    2. How can I change the flags in the plugin? I’ve read on the official website that “you have to use PNG or JPG files and name them with the WordPress locale. For example, en_US.png. Then upload these files in the /wp-content/polylang/ directory (create the directory if it does not exist).”

    I did create a folder “polylang” in my computer in the “/wp-content” directory as written above but I do not have the possibility to switch the flags I placed in the “polylang” folder. Should this possibility occur on the wordpress desktop???

    Sorry if the questions are stupid but I’m a new wordpress user

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Chrystl

    (@chrystl)

    Hello

    Could you provide a link to your website?

    EDIT: 2. Did you rename your flag icons with the WordPress Locale?
    i.e: for english => en_GB.png
    And save your changes in Settings > Languages > Settings tab?

    Plugin Support Chrystl

    (@chrystl)

    1. You can create a plugin to do that. Put the code below in php file. And put this file in wp-content/plugins

    <?php
    /*
    Plugin name: Plugin Wen Business
    */
    if( ! function_exists( 'wen_business_header_top_content' ) ) :
      function wen_business_header_top_content(){
    
        $social_in_header = wen_business_get_option( 'social_in_header' );
        $search_in_header = wen_business_get_option( 'search_in_header' );
    
        ?>
    
        <?php if ( ( 1 == $social_in_header && wen_business_is_social_menu_active() ) || 1 == $search_in_header ): ?>
    
          <div id="header-top-content">
            <div class="container">
              <div class="header-top">
    
                  <div class="header-top-inner">
                    <?php if ( 1 == $social_in_header ): ?>
                      <?php the_widget( 'WEN_Business_Social_Widget', array( 'icon_size' => 'small' ) ); ?>
                    <?php endif ?>
                    <?php if ( 1 == $search_in_header ): ?>
                      <div id="header-search-form">
                        <?php get_search_form(); ?>
                      </div><!-- #header-search-form -->
                    <?php endif ?>
                  </div><!-- .header-top-inner -->
    				<ul id="flags">
    				<?php pll_the_languages(array('show_flags'=>1, 'show_names'=>0)); ?>
    				</ul>
              </div><!-- .header-top -->
            </div><!-- .container -->
          </div><!-- #header-top-content -->
    
        <?php endif ?>
    
        <?php
    
      }
    endif;

    As regards the CSS you can do that:

    #flags {
    	float: right;
    	padding: 10px;
    	margin-left: 20px;
    
    }
    
    .lang-item {
    	list-style-type: none;
    	display: inline-block;
    }
    Thread Starter Krzysiek McK

    (@krzysiek-mck)

    Hi Chrystl!

    Sorry for replying so late. I made the plugin you wrote and I added to the CSS the code but unfortunately when I try to view the website it is plain white and nothing is there….

    I copied the code of the plugin to notepad, saved it into .php file but when I tried to install the plugin an error occured: “Unable to find End of Central Dir Record signature” so I zipped the file and then I installed it but the plugin does not work.

    I cannot provide alink to the website as currently it is being made on a localhost (WAMP server). I will put it into a hosting next week.

    Regarding the flags: I cannot rename my flag icons with the WordPress Locale as I do not see them in any folder and the one I made are named just as you wrote.

    Plugin Support Chrystl

    (@chrystl)

    I copied the code of the plugin to notepad

    Use Notepad++.

    Thread Starter Krzysiek McK

    (@krzysiek-mck)

    I did. Still no use.

    Maybe the problem is the fact that I am still doing the website on the WAMP?

    Plugin Support Chrystl

    (@chrystl)

    I am still doing the website on the WAMP?

    That’s not the origin of your problem.

    saved it into .php

    Could you provide a copy screen of the root of your put your file.

    Thread Starter Krzysiek McK

    (@krzysiek-mck)

    You will find the screenshot below:

    http://oi58.tinypic.com/1z5669u.jpg

    Plugin Support Chrystl

    (@chrystl)

    All seems right. I have no idea what goes wrong since it works for me.
    Sorry I can’t help more.

    Thread Starter Krzysiek McK

    (@krzysiek-mck)

    ok thanks anyway

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

The topic ‘Placing language switcher above menu | adding own flags’ is closed to new replies.