testing dropdown images in the topbar
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 23 Jan 2018 15:53:35 +0000 (10:53 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 23 Jan 2018 15:53:35 +0000 (10:53 -0500)
testing different men walker code for the dropdown images

lib/menu-walker.php
package.json

index e3b7f0d..1a5d281 100644 (file)
@@ -30,7 +30,17 @@ class Glm_Theme_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), 'dropdown-image');
-            $item_style .= "<style>#menu-item-".$object->ID." > .sub-menu:before { background-image: url('".$thumbnail[0]."'); min-height: 130px;} #menu-item-".$object->ID." > .sub-menu { padding-top: 155px;}</style>";
+            // $item_style .= "<style>#menu-item-".$object->ID." > .sub-menu:before { background-image: url('".$thumbnail[0]."'); min-height: 130px;} #menu-item-".$object->ID." > .sub-menu { padding-top: 155px;}</style>";
+
+            $item_style .= "<style>
+            #menu-item-".$object->ID."> .sub-menu:before{
+            display: inline-block;
+            width: 200px;
+            height: 100px;
+            content: ' ';
+            background-image: url('".$thumbnail[0]."');
+            background-size: cover;
+            </style>";
         } else {
             $item_style .= "<style>#menu-item-".$object->ID." > .sub-menu:before { background-image: none; } #menu-item-".$object->ID." > .sub-menu { padding-top: 21px;}</style>";
         }
index c2604a1..7e263f9 100644 (file)
@@ -10,5 +10,9 @@
     "grunt-contrib-uglify": "~0.7.0",
     "grunt-contrib-concat": "~0.5.0",
     "grunt-contrib-copy": "~0.7.0"
+  },
+  "dependencies": {
+    "request": "~2.81.0",
+    "node-sass": "~4.7.2"
   }
-}
\ No newline at end of file
+}