Site logo

[Support request] Make dropdown of PolyLang Language switcher

Home Forums Support [Support request] Make dropdown of PolyLang Language switcher

Home Forums Support Make dropdown of PolyLang Language switcher

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2301804
    Chetan Patil

    Dear Support,

    I know this is not related to GP or GP premium.

    I am having difficulty in showing the dropdown menu of polylang languages.
    its in footer.

    Will you please check and help me with the right declarations?

    MINE->> https://prnt.sc/RWEKHhsfJWSa
    EXPECTED: ->> https://prnt.sc/quDWgslcezdw

    Regards

    #2301866
    David
    Staff
    Customer Support

    Hi there,

    how is the Polylang language switcher added ? is it using a shortcode ?

    #2301893
    Chetan Patil

    I have created a shortcode. Code is there in functions.php file.

    
    /**
     * Polylang Shortcode - https://wordpress.org/plugins/polylang/
     * Add this code in your functions.php
     * Put shortcode [polylang_langswitcher] to post/page for display flags
     *
     * @return string
     */
    function custom_polylang_langswitcher() {
    	$output = '';
    	if ( function_exists( 'pll_the_languages' ) ) {
    		$args   = [
    		'show_flags' => 0,
            'hide_if_empty' => 0,
    		'show_names' => 1,
    		'echo'       => 0,
    			];
    		$output = '<ul class="polylang_langswitcher">'.pll_the_languages( $args ). '</ul>';
    	}
    
    	return $output;
    }
    
    add_shortcode( 'polylang_langswitcher', 'custom_polylang_langswitcher' );
    

    I have created temporary login for you.

    Regards

    #2302155
    David
    Staff
    Customer Support

    Why not use the Widget or Blocks that Polylang provides ?

    https://polylang.pro/doc/the-language-switcher/

    #2302207
    Chetan Patil

    Hi,

    These widgets are for Polylang PRO only. Unfortunately I don’t have PRO version.
    Regards

    #2302284
    Ying
    Staff
    Customer Support

    Hi there,

    As you know this is not theme related, we can’t support code that comes from 3rd party.

    I would recommend reaching out to Polylang’s support.

    Thanks for your understanding!

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