Created
March 17, 2017 16:26
-
-
Save Farmatique/c65363235e12ad9f66ad8281983951e4 to your computer and use it in GitHub Desktop.
add custom element inside menu-element in wordpress - 2nd variant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'walker_nav_menu_start_el', 'wpse_45647_add_custom_content', 'icl_post_languages', 10, 2 ); | |
| function wpse_45647_add_custom_content( $item_output, $item ){ | |
| if ('Choose Country' == $item->title) {// choose li-element here | |
| $custom = icl_post_languages();//something custom to add | |
| return str_replace( '<a ', $custom . '<a ', $item_output ); | |
| } else { | |
| return $item_output; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment