Advertisement
Guest User

Untitled

a guest
Dec 20th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.37 KB | None | 0 0
  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.
  68. * El 5 por el 6 en el contador
  69. * La publicidad se muestra después del 2 post en resumen1
  70. * Las cajas cuerpo y contenido-index sólo pueden ejecutarse una
  71. * vez dentro del bucle while, para eso se coloca al final de la caja horizontal
  72. *
  73. */
  74. ?>
  75.  
  76. <?php get_header(); ?>
  77. <div id="escaparate">
  78. <div id="destacadas">
  79. <?php $contador = 0; ?>
  80. <?php while ( have_posts() ) : the_post(); ?>
  81. <?php $contador ++; ?>
  82. <?php if ($contador <= 2) { ?>
  83. <div class="resumen1">
  84. <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
  85. <span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
  86. <span class="desc"><?php echo excerpt(35); ?></span>
  87. </div>
  88.  
  89. </div>
  90. <?php if (contador == 1) { ?>
  91. <div id="viral">
  92. <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>
  93. <span class="viraltext">Aprovecha las últimas novedades</span>
  94. </div>
  95. <?php } ?>
  96. </div>
  97. <?php if (contador == 2) { ?>
  98. <div class="horizontal"><img src="<?php bloginfo('template_url'); ?>/images/gigas.jpg" width="220" height="90" />
  99. <script type="text/javascript"><!--
  100.  
  101. google_ad_width = 728;
  102. google_ad_height = 90;
  103. //-->
  104. </script>
  105. <script type="text/javascript"
  106. src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  107. </script>
  108. </div>
  109. <div id="cuerpo">
  110. <div id="contenido-index">
  111. <?php } ?>
  112.  
  113. <?php }
  114. elseif ($contador > 2 && $contador < 6) { ?>
  115. <div class="resumen2">
  116. <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); } ?>
  117. <span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
  118. <span class="desc"><?php echo excerpt(40); ?></span>
  119. </div>
  120.  
  121. <?php } else { ?>
  122. <div class="resumen3">
  123. <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'home-thumb' ); } ?>
  124. <span class="titulo"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
  125. <span class="desc"><?php echo excerpt(35); ?></span>
  126. </div>
  127.  
  128. <?php } ?>
  129.  
  130. <?php endwhile; ?>
  131.  
  132. <?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>
  133. </div>
  134.  
  135. <?php get_sidebar(); ?>
  136. </div>
  137.  
  138. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement