adding a graphic and updating the menu walker
authorIan Weller <ian@gaslightmedia.com>
Mon, 22 May 2017 16:12:43 +0000 (12:12 -0400)
committerIan Weller <ian@gaslightmedia.com>
Mon, 22 May 2017 16:12:43 +0000 (12:12 -0400)
I added the graphic for the all ticket option and made a place for it in
the menu walker.

assets/All-Tickets-to-Mackinac-Island-Option-Featured-Image.png [new file with mode: 0644]
lib/menu-walker.php

diff --git a/assets/All-Tickets-to-Mackinac-Island-Option-Featured-Image.png b/assets/All-Tickets-to-Mackinac-Island-Option-Featured-Image.png
new file mode 100644 (file)
index 0000000..b6d904b
Binary files /dev/null and b/assets/All-Tickets-to-Mackinac-Island-Option-Featured-Image.png differ
index 946f7b0..04a4d41 100644 (file)
@@ -74,6 +74,19 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             background-position: center bottom;
             </style>";
 
+        } else if($object->classes[0] === 'all-ticket-options' ){
+            $thumbnail = get_template_directory_uri() . '/assets/All-Tickets-to-Mackinac-Island-Option-Featured-Image.png';
+            $item_style .= "<style>
+            #menu-main #menu-item-".$object->ID.":before {
+            display: inline-block;
+            width: 200px;
+            height: 100px;
+            content: ' ';
+            background-image: url('".$thumbnail."');
+            background-size: cover;
+            background-position: center bottom;
+            </style>";
+
         }else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){
             $thumbnail = get_template_directory_uri() . '/assets/is43-1401554613-28521.jpg';
             $item_style .= "<style>