From: Anthony Talarico Date: Fri, 24 Mar 2017 18:34:46 +0000 (-0400) Subject: adding images to the custom page links in the buy tickets dropdown menu X-Git-Tag: v1.0.0^2~34 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5b5d44c413b65a00acb6d37269bbafd29ac68769;p=WP-Themes%2Fmackinawferry.git adding images to the custom page links in the buy tickets dropdown menu --- diff --git a/assets/Multiple trips.jpg b/assets/Multiple trips.jpg new file mode 100644 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 index 0000000..b35660e Binary files /dev/null and b/assets/family specials for nav.jpg differ diff --git a/lib/menu-walker.php b/lib/menu-walker.php index 53b149f..aee5a43 100644 --- a/lib/menu-walker.php +++ b/lib/menu-walker.php @@ -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 '
', print_r($object), '
'; + // if($object->ID == 330 && $object->has_children == 1){ // $item_html .= ""; // } ////// echo "
", print_r($object), "
"; 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 .= ""; - } 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 .= ""; - - } 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 .= ""; + + }else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){ $thumbnail = get_template_directory_uri() . '/assets/interior-pg-header-image.jpg'; $item_style .= ""; - } + } //$output .= ( 0 == $depth ) ? '
  • ' : ''; $classes = empty( $object->classes ) ? array() : (array) $object->classes; if ( in_array( 'label', $classes ) ) {