Skip to content

Instantly share code, notes, and snippets.

@dleeward
Created June 14, 2018 12:31
Show Gist options
  • Save dleeward/4c15d2b092ef778bceb4e8ac4b7423bb to your computer and use it in GitHub Desktop.
Save dleeward/4c15d2b092ef778bceb4e8ac4b7423bb to your computer and use it in GitHub Desktop.
Marker Code
<h3>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h3>
<?php
$street = get_post_meta( $post_ID, 'cp_street' , true );
if ( $street) { $street = $street . ', '; }
$city = get_post_meta( $post_ID, 'cp_city' , true );
if ( $city) { $city = $city . ' '; }
$state = get_post_meta( $post_ID, 'cp_state' , true );
if ( $state) { $state = $state . ' '; }
$region = get_post_meta( $post_ID, 'cp_region' , true );
if ( $region) { $region = $region . ' '; }
$zip = get_post_meta( $post_ID, 'cp_zipcode' , true );
if ( $zip) { $zip = $zip . ' '; }
$country = get_post_meta( $post_ID, 'cp_country' , true );
$address = $city . $state . $region . $zip . $country ;
if ( $address ) {
echo '<div class="street"' . $street . '</div>';
if ( $address ) {
echo '<div class="address"' . $address . '</div>';
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment