// Insert style to display page's thumbnail
$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 ), 'large' );
-
- $item_style .= "<style>
- #menu-item-".$object->ID.":before {
- display: inline-block;
- width: 200px;
- height: 300px;
- content: ' ';
- background-image: url('".$thumbnail[0]."');
- background-size: cover;
- </style>";
+// echo '<pre>', print_r($object->classes[0]) ,'</pre>';
+
+ $thumbnail = '';
+ switch( $object->classes[0] ){
+ case 'destinations-dropdown':
+ $thumbnail = get_stylesheet_directory_uri() .'/assets/bond-falls.jpg';
+ break;
+ case 'events-dropdown':
+ $thumbnail = get_stylesheet_directory_uri() .'/assets/pumpkins.jpg';
+ break;
+ case 'eat-dropdown':
+ $thumbnail = get_stylesheet_directory_uri() .'/assets/food.jpg';
+ break;
+ case 'adventures-dropdown':
+ $thumbnail = get_stylesheet_directory_uri() .'/assets/Adventure-bike.jpg';
+ break;
+ }
- } else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){
+ if ( $depth !== 0 ) {
+// $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( (int)$object->object_id ), 'large' );
- $thumbnail = get_template_directory_uri() . '/assets/header-images-2.jpg';
$item_style .= "<style>
#menu-item-".$object->ID.":before {
display: inline-block;
background-image: url('".$thumbnail."');
background-size: cover;
</style>";
+
}
+// else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){
+//
+// $thumbnail = get_template_directory_uri() . '/assets/header-images-2.jpg';
+// $item_style .= "<style>
+// #menu-item-".$object->ID.":before {
+// display: inline-block;
+// width: 200px;
+// height: 300px;
+// content: ' ';
+// 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 ) ) {