I found one easy way to do it, by simply adding the thumbnail path to the menu label. I like that pretty well, but I don’t think the users will go for it. 🙂
So, instead of the menu label being:
Something
I made it:
<img src="/path/to/thumb/somethingthumb.png">Something
Anyone got a way to connect wp_nav_menu() to the_post_thumbnail()?
Ok. So, in a fit of heroic coding/forum reading I came across this post:
http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/
Which led me to make a copy of the wp_nav_menu() function called my_wp_nav_menu in my theme’s function.php file. Then, I found the part where the menu object is most editable, @ line 195, after sorting and before walk_nav_menu_tree(). Added this:
foreach($sorted_menu_items as $val) {
$title = get_the_post_thumbnail($val->object_id, 'medium') . '<br />' . $val->title;
$val->title = $title;
//$val->title .= ' ' . $val->ID;
}
This results in just what I wanted, a user-adminnable menu with automatic inclusion of thumbnails in only one of the two menus of the theme!