adding images to the custom page links in the buy tickets dropdown menu
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 24 Mar 2017 18:34:46 +0000 (14:34 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 24 Mar 2017 18:34:46 +0000 (14:34 -0400)
assets/Multiple trips.jpg [new file with mode: 0644]
assets/family specials for nav.jpg [new file with mode: 0644]
lib/menu-walker.php

diff --git a/assets/Multiple trips.jpg b/assets/Multiple trips.jpg
new file mode 100644 (file)
index 0000000..323cf53
Binary files /dev/null and b/assets/Multiple trips.jpg differ
diff --git a/assets/family specials for nav.jpg b/assets/family specials for nav.jpg
new file mode 100644 (file)
index 0000000..b35660e
Binary files /dev/null and b/assets/family specials for nav.jpg differ
index 53b149f..aee5a43 100644 (file)
@@ -27,14 +27,16 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
 
         // Insert style to display page's thumbnail $depth == 0 && has_post_thumbnail((int)$object->object_id
         $item_style = '';
+//        echo $object->classes[0]; 
 //        echo '<pre>', print_r($object), '</pre>';
+    
 //        if($object->ID == 330 && $object->has_children == 1){
 //            $item_html .= "<ul class='sub-menu dropdown medium-block-grid-9'><li>test</li></ul>";
 //        }
 //////        echo "<pre>", print_r($object), "</pre>";
         if ( $depth !== 0 && has_post_thumbnail( (int)$object->object_id ) ) {
           
-             $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( (int)$object->object_id ), 'large' );
+            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( (int)$object->object_id ), 'large' );
 
             $item_style .= "<style>
             #menu-main #menu-item-".$object->ID.":before {
@@ -46,10 +48,8 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             background-size: cover;
             </style>";
 
-        } else if( $depth !== 0 && $object->type == "taxonomy") {
-
-            $thumbnail = z_taxonomy_image_url( (int)$object->object_id );
-
+        } else if($object->classes[0] === 'family-specials' ){
+            $thumbnail = get_template_directory_uri() . '/assets/family%20specials%20for%20nav.jpg';
             $item_style .= "<style>
             #menu-main #menu-item-".$object->ID.":before {
             display: inline-block;
@@ -58,9 +58,23 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             content: ' ';
             background-image: url('".$thumbnail."');
             background-size: cover;
+            background-position: center bottom;
             </style>";
-
-        } else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){
+            
+        } else if($object->classes[0] === 'multiple-trips' ){
+            $thumbnail = get_template_directory_uri() . '/assets/Multiple%20trips.jpg';
+            $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/interior-pg-header-image.jpg';
             $item_style .= "<style>
             #menu-main #menu-item-".$object->ID.":before {
@@ -71,7 +85,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             background-image: url('".$thumbnail."');
             background-size: cover;
             </style>";
-        }
+        } 
         //$output .= ( 0 == $depth ) ? '<li class="divider"></li>' : '';
         $classes = empty( $object->classes ) ? array() : (array) $object->classes;
         if ( in_array( 'label', $classes ) ) {