From: Steve Sutton Date: Wed, 14 Oct 2015 15:16:38 +0000 (-0400) Subject: Update drop down menu X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e623ac15d29f77d2f27deea9edcf67dec99cdbbb;p=WP-Themes%2Fglmthemes%2Fbpla-theme.git Update drop down menu Worked out a way to add the featured images into the drop down nav using jquery to add an image tag. --- diff --git a/functions.php b/functions.php index da4f409..6718484 100644 --- a/functions.php +++ b/functions.php @@ -123,8 +123,8 @@ class Feature_Top_Bar_Walker extends Walker_Nav_Menu { // 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), 'medium'); - $item_style .= ""; + $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'bpla-drop-down'); + //$item_style .= ""; } //$output .= ( 0 == $depth ) ? '
  • ' : ''; $classes = empty( $object->classes ) ? array() : (array) $object->classes; @@ -135,13 +135,23 @@ class Feature_Top_Bar_Walker extends Walker_Nav_Menu { if ( in_array( 'divider', $classes ) ) { $item_html = preg_replace( '/]*>( .* )<\/a>/iU', '', $item_html ); } - if ($item_style) + if ($item_style) { $output .= $item_style; + } + if ($depth == 0 && has_post_thumbnail((int)$object->object_id) && $object->has_children) { + $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'bpla-drop-down'); + $item_html .= ''; + //$item_html .= '
    ' . print_r($object, true) . '
    '; + } $output .= $item_html; } function start_lvl( &$output, $depth = 0, $args = array() ) { - $output .= "\n