?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header class="entry-header"> <div class="entry-meta"> <span class="posted-on"> <?php echo wp_kses(wanderlist_date(get_the_ID(), 'range-ext'), wanderlist_date_allowed_html()); ?> </span> <span class="tags-links"> <?php the_terms(get_the_ID(), 'wanderlist-trip', 'Trip: ', ', ', ' ·'); ?> <?php the_terms(get_the_ID(), 'wanderlist-country', '', ', '); ?> </span> </div><!-- .entry-meta --> <?php the_title('<h1 class="entry-title">', '</h1>'); ?> </header><!-- .entry-header -->
function wanderlist_format_location($id, $options = null) { // Set default value for $today variable. (Is it "today"?) $today = false; // If we're still visiting somewhere, show that location with "today" if (wanderlist_today() >= get_post_meta($id, 'wanderlist-arrival-date', true) && wanderlist_today() <= get_post_meta($id, 'wanderlist-departure-date', true)) { $today = true; $output = '<dt>' . esc_html__('Today', 'wanderlist') . '</dt>'; // If this is our home and we haven't entered a departure date, show it as "today" as well } elseif (wanderlist_is_home($id) && '' == get_post_meta($id, 'wanderlist-departure-date', true)) { $output = '<dt>' . esc_html__('Today', 'wanderlist') . '</dt>'; // If we've opted to show the date range, show the date range, silly! } elseif ('range' === $options['date_format']) { $output = '<dt>' . esc_html(wanderlist_date($id, 'range')) . '</dt>'; } else { // Otherwise, display the date of arrival $output = '<dt>' . esc_html(wanderlist_date($id, 'arrival')) . '</dt>'; } // Spit out coordinates for Mapbox to use $output .= '<dd class="wanderlist-place" data-city="' . esc_html(wanderlist_place_data('city', $id)) . '" data-lat="' . esc_attr(wanderlist_place_data('lat', $id)) . '" data-lng="' . esc_attr(wanderlist_place_data('lng', $id)) . '">'; // Show a link to full post if: a) user hasn't opted out of showing, and // b) the place isn't one you're still busy exploring $options = get_option('wanderlist_settings'); $hide_link = false; // Our default is to show links. // Override the user has opted-out of links. if ($options && array_key_exists('wanderlist_hide_link_to_location', $options)) { if ('1' === $options['wanderlist_hide_link_to_location']) { $hide_link = true; } } if (false === $hide_link && true !== $today) { $output .= '<a href="' . esc_url(get_the_permalink($id)) . '">'; } // Show the title $output .= esc_html(get_the_title($id)); if (false === $hide_link && true !== $today) { $output .= '</a>'; } // Display some icons if the location is home or loved if (wanderlist_is_loved($id)) { //$output .= '<span class="wanderlist-loved">♥</span>'; } if (wanderlist_is_home($id)) { //$output .= '<span class="wanderlist-home">☆</span>'; } $output .= '</dd>'; return $output; }