• Hello, and thank you for a WONDERFUL Plugin..

    I am currently using this code to add the language switcher to my nav menu and it is working great… :

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    /* adding multisite language switcher to main menu */
    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 .= '
    <li>' . implode( '</li>
    <li>', $arr ) . '</li>
    ';
            }
        }
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );

    I would like to be able to add it to other areas using thesis hooks …

    can you please tell me the code to use? i do apologise for any inconvenience, I tried changing the ‘wp_nav_menu_items’ with for example ‘thesis_hook_header’ but it didn’t appear to work…

    thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sorry for the delay … I saw your post this morning in my RSS feed (?).

    I’m not sure if I got it completely but you can get the output with the function get_the_msls(). But it depends on the hook how you should design a filter or an action.

    Could you give me more information?

    Thread Starter cielle

    (@cielle)

    Hi realloc, sorry, i am not a php expert!

    I don’t know what more information you need, usually when i add a function to my thesis wordpress i do it like so…

    function mslw() {
    add the code here...
    }
    add_action('thesis_header', 'mslw');

    So i am not sure how i would add the language switcher in this way to my header?

    I hope this is clearer now??

    thank you so much for your time!

    So something like this could work

    add_action( 'thesis_header', 'the_msls' );

    Cheers,
    Dennis.

    Thread Starter cielle

    (@cielle)

    thanks Dennis, no, that does not seem to work, it is the code in the middle ( where i say “add code here” that i need help with… )

    thanks for your time, i do appreciate it, I don’t mean to add to your already busy workload!

    Strange. This line should be more or less the same like …

    function mslw() {
        the_msls();
    }
    add_action( 'thesis_header', 'mslw' );

    or

    function mslw() {
        echo get_the_msls();
    }
    add_action( 'thesis_header', 'mslw' );

    Are you sure that ‘thesis-header’ is the right hook? Please have a look at this post for example.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘adding multisite language switcher to my thesis header’ is closed to new replies.