/** * Fuction to show the single post content. */ function interface_theloop_for_single() { global $post; if (have_posts()) { while (have_posts()) { the_post(); do_action('interface_before_post'); ?> <section id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <article> <header class="entry-header"> <?php if (get_the_time(get_option('date_format'))) { ?> <div class="entry-meta"> <span class="cat-links"> <?php the_category(', '); ?> </span> <h1 class="entry-title"><?php the_title(); ?> </h1> <div class="entry-meta clearfix"> <div class="by-author vcard author"><span class="fn"><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " title="<?php esc_attr(the_author()); ?> "> <?php the_author(); ?> </a></span></div> <div class="date updated"><a href="<?php the_permalink(); ?> " title="<?php echo esc_attr(get_the_time()); ?> "> <?php the_time(get_option('date_format')); ?> </a></div> <?php if (comments_open()) { ?> <div class="comments"> <?php comments_popup_link(__('Sin comentarios', 'interface'), __('1 Comentario', 'interface'), __('% Comentarios', 'interface'), '', __('Comments Off', 'interface')); ?> </div> <?php } ?> </div> <!-- .entry-title --> <?php $term_list = get_the_term_list(get_the_ID(), array('localidad', 'region', 'fecha', 'responsable')); if (!empty($term_list)) { ?> <center> <?php $images =& get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image')); if (empty($images)) { // no attachments here } else { echo '<br>'; foreach ($images as $attachment_id => $attachment) { echo wp_get_attachment_link($attachment_id, 'icon') . ' '; } echo '<br><br>'; } ?> </center> <blockquote> <?php $my_meta = get_post_meta($post->ID, '_my_meta', TRUE); if (!empty($my_meta['description'])) { echo '<b>' . $my_meta['description'] . '</b><br><br>'; } if (!empty($my_meta['name'])) { echo '<strong>Dirección:</strong> ' . $my_meta['name'] . '<br>'; } ?> <?php $term_list = get_the_term_list(get_the_ID(), 'localidad'); if (!empty($term_list)) { ?> <strong>Localidad:</strong> <?php echo get_the_term_list($post->ID, 'localidad', '', ', '); } ?> <?php $term_list = get_the_term_list(get_the_ID(), 'region'); if (!empty($term_list)) { ?> (<?php echo get_the_term_list($post->ID, 'region', '', ', '); ?> )<?php } ?> <?php echo get_the_term_list($post->ID, 'responsable', '<br><strong>Autoría:</strong> ', ' | '); ?> <?php echo get_the_term_list($post->ID, 'fecha', '<br><strong>Fecha:</strong> ', ', '); ?> <br> <?php if (function_exists('geo_mashup_map')) { $coords = GeoMashup::post_coordinates(); } if ($coords) { echo '<strong>Coordenadas:</strong> '; echo $coords['lat']; echo ' / '; echo $coords['lng']; echo ' <a href="http://maps.google.com/maps?q='; echo $coords['lat']; echo ','; echo $coords['lng']; echo '" title="Ver en Google Maps" target="_blank"> →</a>'; } ?> <br> <?php $my_meta = get_post_meta($post->ID, '_my_meta', TRUE); if (!empty($my_meta['fuente'])) { echo '[<a target="_blank" title="Información complementaria en nueva pestaña" href="' . $my_meta['fuente'] . '"><strong>+ info</strong></a>]<br>'; } ?> </blockquote> <?php echo GeoMashup::map("width=100%&height=350&zoom=16"); ?> <br> <?php } ?> <!-- .cat-links --> </div> <!-- .entry-meta --> <div class="entry-meta clearfix"> <div class="entry-meta clearfix"> <?php $term_list = get_the_term_list(get_the_ID(), array('localidad', 'region', 'fecha', 'responsable')); if (empty($term_list)) { if (has_post_thumbnail()) { $image = ''; $title_attribute = apply_filters('the_title', get_the_title($post->ID)); $image .= '<figure class="">'; $image .= get_the_post_thumbnail($post->ID, 'featured', array('alt' => esc_attr($title_attribute))) . ''; $image .= '</figure>'; echo $image; } ?> <?php } ?> <!-- .entry-meta --> </header> <!-- .entry-header --> <?php } ?> <div class="entry-content clearfix"> <?php the_content(); wp_link_pages(array('before' => '<div style="clear: both;"></div><div class="pagination clearfix">' . __('Pages:', 'interface'), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '%', 'echo' => 1)); ?> </div> <?php if (get_the_time(get_option('date_format'))) { ?> </header> <?php } ?> <!-- entry content clearfix --> <?php if (is_single()) { $tag_list = get_the_tag_list('', __(' ', 'interface')); if (!empty($tag_list)) { ?> <footer class="entry-meta clearfix"> <span class="tag-links"> <?php echo $tag_list; ?> </span><!-- .tag-links --> </footer> <!-- .entry-meta --> <?php } do_action('interface_after_post_content'); } do_action('interface_before_comments_template'); comments_template(); do_action('interface_after_comments_template'); ?> </article> </section> <!-- .post --> <?php do_action('interface_after_post'); } } else { ?> <h1 class="entry-title"> <?php _e('No hay resultados para la búsqueda.', 'interface'); ?> </h1> <?php } }