WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
[resolved] Navigational Menu (7 posts)

  1. andrewfong
    Member
    Posted 11 months ago #

    Firstly, wonderful plugin - thanks for the time you put into this.

    Here's my problem. I have designed a site for my friend who is starting a business - he didn't tell me he wanted it in 3 languages until a week into the implementation. Anyway, I have settled on a multisite solution. Its all going smoothly, I have the 3 sites setup.

    My website: http://www.englishlodge.es

    I would like the language switcher in the navigational menu. Is this possible? I have very little knowledge of PHP or css so any help is greatly received.

    The theme I am using across the 3 sites is 'TheOnePager', by Woothemes.

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

  2. realloc
    Member
    Plugin Author

    Posted 11 months ago #

  3. andrewfong
    Member
    Posted 11 months ago #

    Thanks for the reply. I have tried the final method with no luck - is there a way of viewing the page source to find out what the table is called in my theme?

  4. realloc
    Member
    Plugin Author

    Posted 11 months ago #

    Yes, look for a call to register_nav_menu or register_nav_menus in the functions.php of your theme. Maybe you'll find it there.

  5. andrewfong
    Member
    Posted 11 months ago #

    Thanks realloc - I'll try that now & post results asap.

    No luck. Any other thoughts?

  6. andrewfong
    Member
    Posted 11 months ago #

    Ok no so 'register_nav_menu' or menus in the functions.php.

    I have found the correct section located in the theme-functions.php of my theme in the editor.

    /*-----------------------------------------------------------------------------------*/
    /* Register WP Menus */
    /*-----------------------------------------------------------------------------------*/
    if ( function_exists( 'wp_nav_menu') ) {
    	add_theme_support( 'nav-menus' );
    	register_nav_menus( array( 'top-menu' => __( 'Top Menu', 'woothemes' ) ) );
    }

    Adding this

    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 .= '
  7. ' . implode( '
  8. ', $arr ) . '
  9. ';
    }
    }
    return $items;
    }
    add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );
    doesn't do anything. What should I change and where should I insert it?

  10. realloc
    Member
    Plugin Author

    Posted 11 months ago #

    Seems the menu called 'top-menu' and not 'primary'. Just change this and it will work.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.