Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $wp_query;
- $postid = $wp_query->post->ID;
- $mix_venue = get_post_meta($postid, 'mix_venue', true);
- $mix_url = get_post_meta($postid, 'mix_url', true);
- $mix_date = get_post_meta($postid, 'mix_date', true);
- // Set mix date to Unix timestamp format
- if (!empty($mix_date)){
- $mix_day = substr($mix_date, 1,2 );
- $mix_month = substr ($mix_date, 4,5);
- $mix_year = substr($mix_date, 6,10);
- $timestamp = mktime(0,0,0,$mix_month,$mix_day,$mix_year);
- $formateddate = date("l, F jS Y" ,$timestamp);
- }
- // Display Soundcloud mixer with autoplay
- if ((!empty($mix_url))){
- echo do_shortcode('[soundcloud url="' . $mix_url .'" params="color=020202" width=" 100%" iframe="true" /]');
- } else
- echo '';
- // Only display mix info if any has actually been set!
- if ((!empty($mix_date)) && (!empty($mix_venue))){
- echo '<img src="../../wp-content/themes/DJRyan2013/images/icon-venue.png" class="icon"><span class="venuestamp">' . $mix_venue . '</span> <img src="../../wp-content/themes/DJRyan2013/images/icon-calendar.png" class="icon"> <span class="venuestamp">' . $formateddate . '</span>';
- } else
- echo '';
- if ((!empty($mix_url))){
- echo ' <img src="../../wp-content/themes/DJRyan2013/images/icon-clock.png" class="icon"><span class="venuestamp">' . $mix_url;
- } else
- echo '';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement