WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
[resolved] flags in Hatch theme menu (7 posts)

  1. polypa
    Member
    Posted 2 years ago #

    Hello !

    I am trying to have the flags displayed at the very right of the menu in this website :

    http://portraitiste.org/fr

    The theme I used is Hatch. Please note the english and spanish versions are not yet written. I did notice things work great btw :)

    I tried plenty of ways to add the code in header and menu php files, so far with no avail...
    Would anyone have a hint ? I saw at least one site that managed to do what I mean :
    http://lloc.de/

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

  2. realloc
    Member
    Plugin Author

    Posted 2 years ago #

    You could try to add some code in the functions.php of your theme. Please have a look here -> "Manipulate the Navigation Menu" at https://github.com/lloc/Multisite-Language-Switcher/wiki/Generate-the-output ...

    Cheers,
    Dennis.

  3. polypa
    Member
    Posted 2 years ago #

    Great ! Thank you, it worked like a charm :)

    Marking as resolved

  4. gioinviaggio
    Member
    Posted 2 years ago #

    Hi!

    I've found this post very useful as I had the same problem as Polypa.

    I have one more question : how is possible to show the desciption on the language near the flag??

    And, I've inserted the code...

    -----------------------

    function my_custom_menu_item( $items, $args ) {
    if ( class_exists( 'MslsOutput' ) && 'primary' == $args->theme_location ) {
    $obj = new MslsOutput;
    $arr = $obj->get( 2 );
    if ( !empty( $arr ) ) {
    $items .= '

  5. ' . implode( '
  6. ', $arr ) . '
  7. ';
    }
    }
    return $items;
    }
    add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );

    --------------------

    ...quite randomly in the function.php page under the section //SIDEBAR. It is ok or I've to copy it in a proper position??

    Sorry I'm just beginner!

    thanks for the support!

    Giorgio

    http://www.gioinviaggio.com

  • realloc
    Member
    Plugin Author

    Posted 2 years ago #

    No problem! For the first question: Please have a look here!

  • gioinviaggio
    Member
    Posted 2 years ago #

    first of all thanks! I've tryed copy both the codes together but nothing happened. Insead now the flag isn't centered, but set on top of the menu.

    http://www.gioinviaggio.com

    Can you give a look?

    Exactly where I have to place these/that code/codes in the function.php??

    many thanks again for the support!

    Giorgio

  • realloc
    Member
    Plugin Author

    Posted 2 years ago #

    Seems that your html needs li-tags ... ;)

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags

    No tags yet.