View difference between Paste ID: WYCzqwt4 and Q4sKk3X2
SHOW: | | - or go back to the newest paste.
1
<?php get_header(); ?>
2
<div id="escaparate">
3
<div id="destacadas">
4
<?php $contador = 0; ?>
5
<?php while ( have_posts() ) : the_post(); ?>
6
<?php $contador ++; ?>
7
<?php if ($contador <= 2) { ?>
8
<div class="resumen1">
9
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
10
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
11
<span class="desc"><?php echo excerpt(35); ?></span>
12
</div>
13
14
</div>
15
<?php if (contador == 1) { ?>
16
<div id="viral">
17
<script type="text/javascript" src="http://videos.goviral-content.com/playerjs-yt/movistar_12938.js?w=400&h=300&pID=60113&bgc=ffffff&cw=1453177&skinName=light&wmode=window&hideChrome=0"></script>
18
<span class="viraltext">Aprovecha las últimas novedades</span>
19
</div>
20
<?php } ?>
21
</div>
22
<?php if (contador == 1) { ?>
23
<div class="horizontal"><img src="<?php bloginfo('template_url'); ?>/images/gigas.jpg" width="220" height="90" />
24
<script type="text/javascript"><!--
25
26
google_ad_width = 728;
27
google_ad_height = 90;
28
//-->
29
</script>
30
<script type="text/javascript"
31
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
32
</script>
33
</div>
34
<?php } ?>
35
<div id="cuerpo">
36
<div id="contenido-index">
37
<?php }
38
elseif ($contador > 2 && $contador < 5) { ?>
39
<div class="resumen2">
40
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
41
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
42
<span class="desc"><?php echo excerpt(40); ?></span>
43
</div>
44
45
<?php } else { ?>
46
<div class="resumen3">
47
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'home-thumb' ); } ?>
48
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
49
<span class="desc"><?php echo excerpt(35); ?></span>
50
</div>
51
52
<?php } ?>
53
54
<?php endwhile; ?>
55
56
<?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>
57
</div>
58
59
<?php get_sidebar(); ?>
60
</div>
61
62
<?php get_footer(); ?>
63
64
<?php 
65
/*
66
*
67-
* Esta versión tiene las siguientes modificaciones.
67+
* Esta versión tiene las siguientes modificaciones:
68
* contador por $contador
69
* El 5 por el 6 en el contador
70
* La publicidad se muestra después del 2 post en resumen1
71
* Las cajas cuerpo y contenido-index sólo pueden ejecutarse una
72
* vez dentro del bucle while, para eso se coloca al final de la caja horizontal
73
*
74
*/
75
?>
76
77
<?php get_header(); ?>
78
<div id="escaparate">
79
<div id="destacadas">
80
<?php $contador = 0; ?>
81
<?php while ( have_posts() ) : the_post(); ?>
82
<?php $contador ++; ?>
83
<?php if ($contador <= 2) { ?>
84
<div class="resumen1">
85
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
86
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
87
<span class="desc"><?php echo excerpt(35); ?></span>
88
</div>
89
90
</div>
91
<?php if ($contador == 1) { ?>
92
<div id="viral">
93
<script type="text/javascript" src="http://videos.goviral-content.com/playerjs-yt/movistar_12938.js?w=400&h=300&pID=60113&bgc=ffffff&cw=1453177&skinName=light&wmode=window&hideChrome=0"></script>
94
<span class="viraltext">Aprovecha las últimas novedades</span>
95
</div>
96
<?php } ?>
97-
<?php if (contador == 2) { ?>
97+
98
<?php if ($contador == 2) { ?>
99
<div class="horizontal"><img src="<?php bloginfo('template_url'); ?>/images/gigas.jpg" width="220" height="90" />
100
<script type="text/javascript"><!--
101
102
google_ad_width = 728;
103
google_ad_height = 90;
104
//-->
105
</script>
106
<script type="text/javascript"
107
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
108
</script>
109
</div>
110
<div id="cuerpo">
111
<div id="contenido-index">
112
<?php } ?>
113
114
<?php }
115
elseif ($contador > 2 && $contador < 6) { ?>
116
<div class="resumen2">
117
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
118
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
119
<span class="desc"><?php echo excerpt(40); ?></span>
120
</div>
121
122
<?php } else { ?>
123
<div class="resumen3">
124
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'home-thumb' ); } ?>
125
<span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
126
<span class="desc"><?php echo excerpt(35); ?></span>
127
</div>
128
129
<?php } ?>
130
131
<?php endwhile; ?>
132
133
<?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>
134
</div>
135
136
<?php get_sidebar(); ?>
137
</div>
138
139
<?php get_footer(); ?>