Add item to top of menu using a filter in functions.php
I want to add a logo to my main menu. I am using this function:
add_filter( 'wp_nav_menu_items', 'add_logo_to_menu_item', 10, 2 );
function add_logo_to_menu_item ( $items, $args ) {
if ($args-menu == 'main-menu') {
$items .= 'lia href="#"img src="PATH_TO_IMAGE"/a/li';
}
return $items;
}
The problem I am having is I want the logo to be at the top of the menu. This filter currently places it in the last position of the menu. Any ideas?