WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
[resolved] Flag Positioning (8 posts)

  1. ivanguinea
    Member
    Posted 9 months ago #

    Hi there! Many thanks for this awesome plugin.

    I just wanted to know if this little issue I am having has any kind of solution.

    I want to swap position between flags in header, I have been reading for a while but couldn´t find anything.

    Thanks in advance

    http://wordpress.org/plugins/multisite-language-switcher/

  2. realloc
    Member
    Plugin Author

    Posted 9 months ago #

    Thank you. There are a some possibilities. Would you like to describe what you want to do?

    Cheers,
    Dennis.

  3. ivanguinea
    Member
    Posted 9 months ago #

    Yes! The thing is I have 4 flags icons above the navigation menu. Sorry I can´t attach any link.

    The order as displayed is German, English, Spanish and French. Though the order I need is Spanish, English, French and German.

    I can´t get to change them.

    Thanks

  4. realloc
    Member
    Plugin Author

    Posted 9 months ago #

    In the current version you can sort by description and by language-code. Do you have problems to add some lines of code? I could give you an example.

  5. ivanguinea
    Member
    Posted 9 months ago #

    Not a sigle problem on adding lines of codes, shed light on the subjet, I beg you! :)

    Thanks again

  6. realloc
    Member
    Plugin Author

    Posted 9 months ago #

    OK, just begin with the the setup of MSLS in your blogs. Set order by description and change the description to something like "1 - Spanish", "2 - English", "3 - French" and "4 - German".

    For not showing these numbers in the title you could some code in your functions.php

    /**
     * Let's filter the first 4 chars of the description in
     * the generated links
     */
    function my_msls_output_get( $url, $link, $current ) {
    	return sprintf(
    		'<a href="%s" title="%s"%s>%s</a>',
    		$url,
    		substr( $link->txt, 4 ),
    		( $current ? ' class="current"' : '' ),
    		$link
    	);
    }
    add_filter( 'msls_output_get', 'my_msls_output_get', 10, 3 );
    
    /**
     * Let's cosutomize the icon-output
     */
    class MyMslsLink extends MslsLink {
    	protected $format_string = '<img src="{src}" alt=""/>';
    }
    
    /**
     * Le'ts use the above class
     */
    function my_msls_link_create( $display ) {
    	return new MyMslsLink;
    }
    add_filter( 'msls_link_create', 'my_msls_link_create' );

    Read on here: https://github.com/lloc/Multisite-Language-Switcher/wiki/Change-the-output

  7. ivanguinea
    Member
    Posted 9 months ago #

    Great, It did Work perfectly.

    Congrats for that support and usefull tips.

    Thanks!

  8. realloc
    Member
    Plugin Author

    Posted 9 months ago #

    OK, very good.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.