Testing out nav dropdown images
authorLaury GvR <laury@gaslightmedia.com>
Tue, 23 Jan 2018 15:20:44 +0000 (10:20 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 23 Jan 2018 15:20:44 +0000 (10:20 -0500)
functions.php
header.php
lib/menu-walker.php

index f69de83..6153e20 100644 (file)
@@ -140,6 +140,7 @@ add_action('init', 'mytheme_init', 10);
 function wpse_setup_theme() {
     add_image_size('glm-block-image', 290, 190,true);
     add_image_size('glm-blog-feed-image', 500, 320,true);
+    add_image_size('dropdown-image', 300, 200,true); // not actual size, just for testing purposes
 }
 
 add_action( 'after_setup_theme', 'wpse_setup_theme' );
@@ -196,19 +197,4 @@ if (!function_exists('is_in_tree')) {
         }
         return false;
     }
-}
-
-if (!function_exists('ticket_url_base')) {
-    function ticket_url_base()
-    {
-        // get the option for the ticket url from the api plugin
-        // if not found then return false.
-        if ( defined('GLM_MEMBERS_APIS_STARLINE_OPTION_NAME') ) {
-            $starlineOptions  = unserialize( get_option( GLM_MEMBERS_APIS_STARLINE_OPTION_NAME ) );
-            $starlineUrl      = ( isset( $starlineOptions['ticketUrl'] ) ) ? $starlineOptions['ticketUrl'] : '';
-            return $starlineUrl;
-        } else {
-            return false;
-        }
-    }
-}
+}
\ No newline at end of file
index d36ab7b..8cff652 100644 (file)
@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title><?php wp_title(); ?></title>
     <link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri() ; ?>/assets/favicon.ico">
-    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.21">
+    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.0">
     <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" rel="stylesheet">
     <link href="https://fonts.googleapis.com/css?family=Fondamento" rel="stylesheet">
     <?php wp_head(); ?>
index d09caae..e3b7f0d 100644 (file)
@@ -29,8 +29,10 @@ class Glm_Theme_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), 'large');
-            $item_style .= "<style>#menu-item-".$object->ID." > .dropdown:before { background-image: url('".$thumbnail[0]."');</style>";
+            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'dropdown-image');
+            $item_style .= "<style>#menu-item-".$object->ID." > .sub-menu:before { background-image: url('".$thumbnail[0]."'); min-height: 130px;} #menu-item-".$object->ID." > .sub-menu { padding-top: 155px;}</style>";
+        } else {
+            $item_style .= "<style>#menu-item-".$object->ID." > .sub-menu:before { background-image: none; } #menu-item-".$object->ID." > .sub-menu { padding-top: 21px;}</style>";
         }
         //$output .= ( 0 == $depth ) ? '<li class="divider"></li>' : '';
         $classes = empty( $object->classes ) ? array() : (array) $object->classes;
@@ -47,7 +49,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
     }
 
     function start_lvl( &$output, $depth = 0, $args = array() ) {
-        $output .= "\n<ul class=\"sub-menu dropdown\">\n";
+        $output .= "\n<ul class=\"sub-menu dropdown\"'>\n";
     }
 }
 endif;