Advertisement
Guest User

Jcarrousel wordpress

a guest
Oct 5th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. ---------------------------------------------------------------------------------------------
  2. PHP:
  3. ----------------------------------------------------------------------------------------------
  4. <div class="destacados_box">
  5. <ul id="destacados_slide" class="jcarousel-skin-tango">
  6. <?php
  7. query_posts('tag=destacados&showposts=3');
  8. while (have_posts()) : the_post();
  9. ?>
  10.  
  11. <li>
  12. <div class="post-destacado">
  13. <div class="imagen_principal">
  14. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail( 'featured-image' ); ?></a>
  15. <h3>
  16. <span><?php
  17. $category = get_the_category();
  18. if($category[0]){
  19. echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';
  20. }
  21. ?></span>
  22. </h3>
  23. </div>
  24. <span class="fecha-destacado">Publicado Hace <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ''; ?> </span>
  25. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  26. <p><?php echo string_limit_words(get_the_excerpt(), 40); ?>... <span class="seguir-leyendo"><a href="<?php the_permalink() ?>">&iexcl;Seguir Leyendo!</a></span></p>
  27. </div>
  28. </li>
  29. <?php endwhile; ?>
  30. <?php wp_reset_query(); ?>
  31. </ul>
  32. <a href="#" id="destacados_slide-prev" class="anterior"><img src="<?php bloginfo('template_directory'); ?>/images/anterior-slide.png" title="Anterior"></a>
  33. <a href="#" id="destacados_slide-next" class="siguiente"><img src="<?php bloginfo('template_directory'); ?>/images/siguiente-slide.png" title="Siguiente"></a>
  34. </div>
  35.  
  36. ---------------------------------------------------------------------------------------------
  37. Configuración de jcarrousel en el header:
  38. ---------------------------------------------------------------------------------------------
  39.  
  40. <script type="text/javascript">
  41.  
  42. function destacados_slide_initCallback(carousel) {
  43.  
  44. jQuery('#destacados_slide-next').bind('click', function() {
  45. carousel.next();
  46. return false;
  47. });
  48. jQuery('#destacados_slide-prev').bind('click', function() {
  49. carousel.prev();
  50. return false;
  51. });
  52. carousel.clip.hover(function() {
  53. carousel.stopAuto();
  54. }, function() {
  55. carousel.startAuto();
  56. });
  57. };
  58.  
  59. jQuery(document).ready(function() {
  60. jQuery('#destacados_slide').jcarousel({
  61. auto: 5,
  62. scroll: 1,
  63. initCallback: destacados_slide_initCallback,
  64. wrap: 'circular',
  65. buttonNextHTML: null,
  66. buttonPrevHTML: null
  67. });
  68. jQuery('#video_slide').jcarousel({
  69. vertical: true,
  70. scroll: 4,
  71. initCallback: video_slide_initCallback,
  72. wrap: 'circular',
  73. buttonNextHTML: null,
  74. buttonPrevHTML: null
  75. });
  76. });
  77. </script>
  78.  
  79. ---------------------------------------------------------------------------------------------
  80. Css:
  81. ---------------------------------------------------------------------------------------------
  82.  
  83. /* Destacados Slide */
  84. .destacados_box {
  85. width: 620px;
  86. position: relative;
  87. }
  88.  
  89. .post-destacado {
  90. margin-bottom: 30px;
  91. }
  92.  
  93. .post-destacado h2, .post-destacado h2 a {
  94. font-size: 28px;
  95. font-family: Trebuchet MS,arial,helvetica,sans-serif;
  96. color: #D00000;
  97. line-height:1.1em;
  98. margin: 0 0 5px 0;
  99. font-weight: 600;
  100. }
  101.  
  102. .post-destacado p{
  103. padding: 0;
  104. margin: 0 0 5px 0;
  105. font-size: 14px;
  106. color: #545454;
  107. line-height: 1.2em;
  108. letter-spacing: normal;
  109. }
  110.  
  111. .post-destacado .imagen_principal {
  112. position: relative;
  113. margin-bottom: 7px;
  114. border: 0;
  115. }
  116.  
  117. .post-destacado .imagen_principal a {
  118. display: block
  119. }
  120.  
  121. .post-destacado .imagen_principal h3 {
  122. position: absolute;
  123. top: 0;
  124. left: 0;
  125. margin:0;
  126. }
  127.  
  128. .post-destacado .imagen_principal h3 span a {
  129. color: white;
  130. font-size: 20px;
  131. font-family: 'BebasNeueRegular';
  132. background: #D00000; /* fallback color */
  133. background: #D00000;
  134. padding: 3px 14px;
  135. text-transform: uppercase;
  136. }
  137.  
  138. .post-destacado .imagen_frame a {
  139. display:block
  140. }
  141.  
  142. span.fecha-destacado {
  143. font-size: 11px;
  144. color: #929292;
  145. text-transform: uppercase;
  146. }
  147.  
  148. span.seguir-leyendo a {
  149. font-weight: 600;
  150. color: #D00000;
  151. }
  152.  
  153. /* Jcarousel */
  154. .jcarousel-skin-tango .jcarousel-container {
  155. float: left;
  156. }
  157.  
  158. .jcarousel-skin-tango .jcarousel-direction-rtl {
  159. direction: rtl;
  160. }
  161.  
  162. .jcarousel-skin-tango .jcarousel-container-horizontal {
  163. width: 620x;
  164. }
  165.  
  166. .jcarousel-skin-tango .jcarousel-clip {
  167. overflow: hidden;
  168. }
  169.  
  170. .jcarousel-skin-tango .jcarousel-clip-horizontal {
  171. width: 620px;
  172. }
  173.  
  174. .jcarousel-skin-tango .jcarousel-item {
  175. width: 620px;
  176. }
  177.  
  178. .jcarousel-skin-tango .jcarousel-item-horizontal {
  179. margin-left: 0;
  180. }
  181.  
  182. .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal {
  183. margin-left: 10px;
  184. margin-right: 0;
  185. }
  186.  
  187. .jcarousel-skin-tango .jcarousel-item-placeholder {
  188. background: #fff;
  189. color: #000;
  190. }
  191.  
  192. .jcarousel-skin-tango {
  193. width: 274px;
  194. margin: 0 2px 0 0;
  195. }
  196.  
  197. .jcarousel-skin-tango {
  198. height: 240px;
  199. }
  200.  
  201. .jcarousel-skin-tango {
  202. width: 270px;
  203. height: 60px;
  204. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement