1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php 
$my_query = null;
$my_query = new WP_Query(array('post_type'=>array('post','articulos'),));
if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); 
if ($my_query->post->post_type == 'post') {?>

<div id="post">
<div id="informacion">
<span class="categorias">
<?php foreach((get_the_category()) as $category) { 
echo '<li class="cat-' .$category->cat_name. '"><a href="'.get_category_link($category->term_id ).'">' . $category->cat_name . '</a></li>';}?>
</span><span class="date"><?php the_time('d/m/Y') ?></span></div>
<div class="clear"></div>
<div id="imagenpost"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'thumbnail', $attr ); ?></a></div>
<div id="postcontent"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><h1><?php the_title(); ?></h1></a>
<h2><?php the_subheading(); ?></h2>
<?php the_excerpt() ?></div>
<div class="clear"></div>
</div>

<?php } if ($my_query->post->post_type == 'articulos') {?>

<div id="post">
<div id="informacion">
<span class="categorias">
<?php foreach((get_the_category()) as $categorias) { 
echo '<li class="cat-item-' .$categorias->term_id. '"><a href="'.get_category_link($categorias->term_id ).'">' . $categorias->cat_name . '</a></li>';}?></span>
</div>
<div class="clear"></div>
<div id="postcontent2"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><h1><?php the_title(); ?></h1></a>
<div class="postmeta">
<div class="addthis_toolbox addthis_default_style" style="float:right;height:20px;margin-top:-4px;width:343px;">
<a class="addthis_button_facebook_like" fb:like:width="120" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-508b032410916f8c"></script>
Escrito por <?php the_author_posts_link(); ?> el <?php the_time('d/m/Y') ?>
</div>
<?php the_content('<span class="readmore">Seguir leyendo...</span>'); ?></div>
<div class="clear"></div>
</div>

<?php } else; endwhile;?>
<div id="navigation">
<div class="previous"><?php previous_posts_link( __( 'Anterior' ) ); ?><div class="clear"></div></div>
<div class="next"><?php next_posts_link( __( 'Siguiente' ) ); ?><div class="clear"></div></div>
</div>
<?php endif; ?>
<div class="clear"></div>
</div>