// Insert style to display page's thumbnail $depth == 0 && has_post_thumbnail((int)$object->object_id
$item_style = '';
-// echo $object->classes[0];
+// 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 ), 'medium' );
$item_style .= "<style>
#menu-main #menu-item-".$object->ID.":before {
background-size: cover;
background-position: center bottom;
</style>";
-
+
} else if($object->classes[0] === 'multiple-trips' ){
$thumbnail = get_template_directory_uri() . '/assets/Multiple%20trips.jpg';
$item_style .= "<style>
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>
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 ) ) {