<?php
?>
<?php get_header(); ?>
<!-------PRINCIPAL-------->
<div id="contenido">
<div class="contpost">
<?php if (in_category('colaboradores')) { ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php foreach((get_the_category()) as $category) {
$categoria = $category->cat_ID . ' ';
}?>
<h1 class="single"><?php the_title(); ?></h1>
<p class="author3"><?php the_author_posts_link(); ?></p>
<div class="postauthor"><b><?php the_time('l j F Y g:i a') ?></b> <?php edit_post_link('Editar'); ?></div>
<p><?php the_content(); ?></p>
<?php endwhile; ?>
<div class="navigation"><p><?php posts_nav_link(); ?></p></div>
<?php endif; ?>
<?php wp_reset_query(); ?>
<div class="clear"></div>
<?php comments_template(); ?>
<?php if (in_category('carton')) { ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $do_not_duplicate = $post->ID; ?>
<?php foreach((get_the_category()) as $category) {
$categoria = $category->cat_ID . ' ';
}?>
<h1 class="single"><?php the_title(); ?></h1>
<div class="postauthor"><b><?php the_time('l j F Y g:i a') ?></b> <?php edit_post_link('Editar'); ?></div>
<p><?php the_content(); ?></p>
<div class="postclear">
<div class="postsocial">
<div class="fb">
<iframe src="//www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>&send=false&layout=button_count&width=450&show_faces=true&font&colorscheme=light&action=like&height=21&appId=134075732530" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
</div>
<div class="tw">
<a href="http://twitter.com/share" data-url="<?php the_permalink(); ?>" class="twitter-share-button" data-text="Un freno a las emociones presidenciales" data-count="horizontal" data-via="elcerebrohabla" data-related="elcerebrohabla:Siguenos" data-lang="es">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>
<div class="gl">
<div class="g-plusone" data-size="medium"></div>
</div>
<div class="li">
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="<?php the_permalink(); ?>" data-counter="right"></script>
</div>
</div>
</div>
<?php endwhile; ?>
<div class="navigation"><p><?php posts_nav_link(); ?></p></div>
<?php endif; ?>
<?php wp_reset_query(); ?>
<div class="estcabezalchico">
<h1>Anteriores</h1>
</div>
<?php $events_query = new WP_Query("cat=15&posts_per_page=12"); ?>
<?php if(have_posts()) : ?><?php while($events_query->have_posts()) : $events_query->the_post(); ?>
<?php if( $post->ID == $do_not_duplicate ) continue; ?>
<div class="cuadrorelated">
<div class="imagenrelated">
<?php if(has_post_thumbnail()) { ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('posthumb'); ?></a>
<?php } else {?>
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/hemeroteca.jpg" /></a>
<?php } ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<div class="clear"></div>
<?php comments_template(); ?>
<?php } ?>
<?php } else { ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $do_not_duplicate = $post->ID; ?>
<?php foreach((get_the_category()) as $category) {
$categoria = $category->cat_ID . ' ';
}?>
<h1 class="single"><?php the_title(); ?></h1>
<div class="postauthor"><b><?php the_time('l j F Y g:i a') ?></b> <?php edit_post_link('Editar'); ?></div>
<p><?php the_content(); ?></p>
<?php endwhile; ?>
<div class="navigation"><p><?php posts_nav_link(); ?></p></div>
<?php endif; ?>
<?php wp_reset_query(); ?>
<div class="estcabezalchico">
<h1>Relacionadas</h1>
</div>
<?php $events_query = new WP_Query("cat=15&posts_per_page=12"); ?>
<?php if(have_posts()) : ?><?php while($events_query->have_posts()) : $events_query->the_post(); ?>
<?php if( $post->ID == $do_not_duplicate ) continue; ?>
<div class="cuadrorelated">
<div class="imagenrelated">
<?php if(has_post_thumbnail()) { ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('posthumb'); ?></a>
<?php } else {?>
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/hemeroteca.jpg" /></a>
<?php } ?>
<h1 class="negrocentro"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<div class="clear"></div>
<?php comments_template(); ?>
<?php } ?>
</div>
</div>
<?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
<?php get_footer(); ?>