?> <div id="search-wrap"> <?php echo mh_simple_search($formProperties = array('id' => 'footer-search')); ?> </div> <?php echo random_item_link(); ?> <div class="social-media"> <?php echo social_media(); ?> </div> <ul class="navigation navigation-legal"> <?php echo mh_legal_nav(); ?> </ul> </nav> <p class="default"> Powered by <a href="http://omeka.org/">Omeka</a> + <a href="http://curatescape.org">Curatescape</a> <br>
function single_artist_widget($id) { $blogID = get_blog_by_name('artists'); min_switch_to_blog($blogID); $artist = get_post($id); $thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id($id), array(300, 300))[0]; $post_meta = get_post_custom($id); // assign all columns to variable $artist_columns = artist_columns(); // in case value isn't set in database, set required variables to '' foreach ($artist_columns as $column) { ${$column} = ''; } // assign all fields foreach ($post_meta as $key => $meta) { if (array_key_exists($key, array_flip($artist_columns))) { // if we want this key if (isset($key) && !empty($key)) { ${$key} = trim($meta[0]); } else { ${$key} = ''; } } } reset_blog(); $tour_dates = json_decode($artist_tour_dates); ?> <div class="single-artist-widget"> <?php if ($artist_sponsor != '') { ?> <div class="artist-sponsor">Presented by <img src="<?php echo $artist_sponsor; ?> " /></div> <?php } ?> <h2>Featured Artist <span><?php echo $artist_name; ?> </span></h2> <div class="artist-image" style="background-image:url('<?php echo $thumb_url; ?> ');"></div> <ul class="social"> <?php if ($artist_instagram != '') { echo '<li class="instagram">' . social_media('instagram', $artist_instagram) . '</li>'; } ?> <?php if ($artist_twitter != '') { echo '<li class="twitter">' . social_media('twitter', $artist_twitter) . '</li>'; } ?> <?php if ($artist_soundcloud != '') { echo '<li class="soundcloud">' . social_media('soundcloud', $artist_soundcloud) . '</li>'; } ?> </ul> <?php if (isset($tour_dates) && isset($tour_dates->resultsPage) && isset($tour_dates->resultsPage->results) && isset($tour_dates->resultsPage->results->event) && count($tour_dates->resultsPage->results->event) > 0) { ?> <h4>Upcoming Tour Dates</h4> <ul class="tour-dates"> <?php $i = 0; foreach ($tour_dates->resultsPage->results->event as $date) { $venue = $date->venue->displayName; // stripping separately just in case $display = strstr($date->displayName, ' (', true); $display = strstr($display, ' at ', true); $permalink = $date->uri; if ($display == '') { continue; } $start = DateTime::createFromFormat('Y-m-d', $date->start->date); $start_month = $start->format('M'); $start_day = $start->format('d'); echo '<li>'; echo '<div class="date"><div class="month">' . $start_month . '</div>' . $start_day . '</div>'; echo '<div class="details">'; echo '<a href="' . $permalink . '">' . $display . '</a>'; echo '<div class="location">at ' . $venue . '</div>'; echo '</div>'; echo '</li>'; $i++; if ($i > 4) { break; } } ?> </ul> <?php if ($i > 4) { ?> <a class="view-all" href="http://www.songkick.com/artists/<?php echo $artist_id; ?> " target="_blank">View All Tour Dates</a> <?php } ?> <?php } ?> </div> <?php }