예제 #1
0
<?php

get_header();
global $post;
$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
$fecha = get_fecha($post->ID);
$lugar = get_lugar($post->ID);
$is_aerial = get_vista_aerea($post->ID);
$sabias_que = get_sabias_que($post->ID);
$street_view_url = get_street_view_url($post->ID);
$tiny_url = file_get_contents('http://tinyurl.com/api-create.php?url=' . get_permalink());
?>
	<section class="[ main-image ][ container-fluid ][ no-padding margin-bottom ]">
		<div class="[ clearfix ]">
			<div class="[ col-md-3 ][ hidden-xs hidden-sm ]">
				<div class="embed-responsive embed-responsive-4by3">
					<div id="mapa" class="[ map map--mini ][ embed-responsive-item ]"></div>
				</div>
			</div>
			<div class="[ col-xs-12 col-sm-8 col-md-6 ][ col-sm-offset-2 col-md-offset-0 ][ no-padding ]">
				<img class="[ img-responsive ][ margin-auto ]" src="<?php 
echo $image[0];
?>
">
			</div>
		</div>
	</section>

	<a href="<?php 
echo get_previous_photo_url($post->post_name);
?>
예제 #2
0
/**
 * Regresa toda la información de las fotos de Juan Guzmán
 * @return JSON $infoPhotos
 */
function get_photos_info()
{
    $info_photos = array();
    $args_apas = array('post_type' => 'foto-jg', 'posts_per_page' => -1);
    $query_mapas = new WP_Query($args_apas);
    if ($query_mapas->have_posts()) {
        while ($query_mapas->have_posts()) {
            $query_mapas->the_post();
            global $post;
            $lat = get_lat($post->ID);
            $lng = get_lng($post->ID);
            $lugar = get_lugar($post->ID);
            $fecha = get_fecha($post->ID);
            $decada = get_decada($post->ID);
            $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
            $info_photos[$post->post_name] = array('title' => $post->post_title, 'lat' => $lat, 'lng' => $lng, 'lugar' => $lugar, 'fecha' => $fecha, 'decada' => $decada, 'img_url' => $image[0], 'permalink' => get_permalink($post->ID));
        }
    }
    wp_reset_query();
    return json_encode($info_photos);
}