Want to insert a logo as the middle menu item in Wordpress theme
<p>EDIT: I adjusted my parameters to insert the logo directly into the menu, instead of padding a specific menu item. The padding method can easily drive a centered menu off-center. This insertion method should resolve that issue.</p>

<p>I'm working on a theme, and want to create a menu split by a logo. I realize I could just create two menus, but I want this to be as streamlined for the user as possible. I've already been able to get the number of items and target the menu item I want, but I'm not sure how to use my functions.php file to add the class "pad-item" to the <code>&lt;li&gt;</code>.</p>

<p>Here is what I have to find and target the specified item. All it's returning, though, is an index number of top level items.</p>

<pre><code>$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object($locations['primary']);
$items = wp_get_nav_menu_items($menu-&gt;term_id);
$top_level = 0;
foreach ($items as $val) {
    if ($val-&gt;menu_item_parent === '0') {
        $top_level++;
    }
}
$index = round($top_level / 2) - 1;
return $index;  
</code></pre>

<p>Any help would be greatly appreciated. Thanks.</p>