// Insert style to display page's thumbnail $depth == 0 && has_post_thumbnail((int)$object->object_id
$item_style = '';
-
- if ( $depth !== 0 ) {
- $thumbnail = z_taxonomy_image_url( (int)$object->object_id );
-
-// $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'large');
+// 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');
+
$item_style .= "<style>
#menu-item-".$object->ID.":before {
display: inline-block;
width: 200px;
height: 100px;
content: ' ';
- background-image: url('".$thumbnail."');
+ background-image: url('".$thumbnail[0]."');
background-size: cover;
</style>";
- } else if ( $depth !== 0 && has_post_thumbnail( (int)$object->object_id ) ) {
+ } else if( $depth !== 0 && $object->type == "taxonomy") {
- $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id( (int)$object->object_id ), 'large');
+ $thumbnail = z_taxonomy_image_url( (int)$object->object_id );
+
$item_style .= "<style>
#menu-item-".$object->ID.":before {
display: inline-block;
width: 200px;
height: 100px;
content: ' ';
- background-image: url('".$thumbnail[0]."');
+ background-image: url('".$thumbnail."');
background-size: cover;
</style>";
}