Update for the menu walker
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 19 Jun 2015 12:14:55 +0000 (08:14 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 19 Jun 2015 12:14:55 +0000 (08:14 -0400)
lib/menu-walker.php

index 0c99cfa..5a532fa 100644 (file)
@@ -23,7 +23,17 @@ class Emmetcounty_Top_Bar_Walker extends Walker_Nav_Menu {
         $item_style = '';
         if ($depth == 0 && has_post_thumbnail((int)$object->object_id)) {
             $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id));
-            //$item_style .= "<style>#menu-item-".$object->ID." > .dropdown:before { background-image: url('".$thumbnail[0]."');</style>";
+            if ($thumbnail[0]) {
+                //$item_style .= '<style>#menu-item-'.$object->ID.' > .dropdown::before {
+                    //border: 5px solid #fdefd4;
+                    //box-shadow: 1px 2px 9px -1px grey;
+                    //height: 140px;
+                    //width: 200px;
+                    //top:20px;
+                    //right:20px;
+                    //position:absolute;content:"";background-image: url("'.$thumbnail[0].'");</style>';
+            }
+            //$item_style .= '<li class="nav-img">' . $thumbnail[0] . '</li>';
         }
         //$output .= ( 0 == $depth ) ? '<li class="divider"></li>' : '';
         $classes = empty( $object->classes ) ? array() : (array) $object->classes;