Title: Insert a combo in menu
Last modified: August 22, 2016

---

# Insert a combo in menu

 *  [symop](https://wordpress.org/support/users/symop/)
 * (@symop)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/)
 * Is possible to insert a combo in menu, in place of flags ? How ?
 * Thanks
 * [https://wordpress.org/plugins/ceceppa-multilingua/](https://wordpress.org/plugins/ceceppa-multilingua/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408600)
 * What does “combo in menu” mean?
    Do you want show languages in submenu? Or ?
 *  Thread Starter [symop](https://wordpress.org/support/users/symop/)
 * (@symop)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408683)
 * yes in a select like this
 * <select>
    <option value=”english”>English</option> <option value=”italian”>Italian
   </option> <option value=”spanish”>Spanish</option> </select>
 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408721)
 * Hi,
 * there is only one function to generate a “pseudo” combo that generate a
    -  list.
       For you can use this code:
 *     ```
       echo '<select>';
       foreach( CMLLanguage::get_all() as $lang ) {
           echo "<option value='$lang->cml_language_slug'>$lang->cml_language</option>";
       }
   
       echo '</select>';
       ```
   
 *  Thread Starter [symop](https://wordpress.org/support/users/symop/)
 * (@symop)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408734)
 * Sorry but this code inside <?php…?> break my site
 *  Thread Starter [symop](https://wordpress.org/support/users/symop/)
 * (@symop)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408753)
 * I don’t understand to put this code in right page of my theme to insert select
   exactly after last item of navigation menu…with plugin I choose to insert in 
   menu and now I have flags after the last item of navigation menu. How can I insert
   select in the same place of it ?
 * PS:
 * 1- I try to insert code in page named navigation-top and now it seems to show
   select, but when I choose one language is not start function and language not
   change….
 * 2- Is possibible to insert only flags icon in place of text “italiano” “english”
   ecc…. ?
 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408758)
 * 1., 2. Use this code:
 *     ```
       echo '<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">';
       foreach( CMLLanguage::get_all() as $lang ) {
             $img = sprintf( '<img src="%s" title="%s" alt="%s" />',
                            CMLLanguage::get_flag_src( $result->id, $size ),
                            $lang->cml_language,
                            sprintf( __( '%1$ flag', 'ceceppaml' ), $result->cml_language_slug ) );
   
           echo '<option value="' . cml_get_the_link( $lang ) . '">' . $img . '</option>";
       }
   
       echo '</select>';
       ```
   
 *  Thread Starter [symop](https://wordpress.org/support/users/symop/)
 * (@symop)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408762)
 * Sorry Alessandro,
    this **<select onchange=”this.options[this.selectedIndex].
   value && (window.location = this.options[this.selectedIndex].value);”>** return
   this url [http://www.xxxxx.it/it/portfolio/en](http://www.xxxxx.it/it/portfolio/en)
   [http://www.xxxxx.it/it/portfolio/es](http://www.xxxxx.it/it/portfolio/es) [http://www.xxxxx.it/it/portfolio/it](http://www.xxxxx.it/it/portfolio/it)
   ecc… with error 404 pagina non trovata!
 * Then last code that you post show a syntax error in **echo ‘</select>’;**
 * Thanks so much for collaboration
 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408774)
 * There is an error in the code, this is the right one:
 *     ```
       echo '<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">';
       foreach( CMLLanguage::get_all() as $lang ) {
             $img = sprintf( '<img src="%s" title="%s" alt="%s" />',
                            CMLLanguage::get_flag_src( $result->id, $size ),
                            $lang->cml_language,
                            sprintf( __( '%1$ flag', 'ceceppaml' ), $result->cml_language_slug ) );
   
           echo '<option value="' . cml_get_the_link( $lang ) . '">' . $img . '</option>';
       }
   
       echo '</select>';
       ```
   
 * Anyway I sent an email to you, let me know 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Insert a combo in menu’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ceceppa-multilingua_4faedb.svg)
 * [Ceceppa Multilingua](https://wordpress.org/plugins/ceceppa-multilingua/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ceceppa-multilingua/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ceceppa-multilingua/)
 * [Active Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ceceppa-multilingua/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/insert-a-combo-in-menu/#post-5408774)
 * Status: not resolved