Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------------------------
- PHP:
- ----------------------------------------------------------------------------------------------
- <div class="destacados_box">
- <ul id="destacados_slide" class="jcarousel-skin-tango">
- <?php
- query_posts('tag=destacados&showposts=3');
- while (have_posts()) : the_post();
- ?>
- <li>
- <div class="post-destacado">
- <div class="imagen_principal">
- <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail( 'featured-image' ); ?></a>
- <h3>
- <span><?php
- $category = get_the_category();
- if($category[0]){
- echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';
- }
- ?></span>
- </h3>
- </div>
- <span class="fecha-destacado">Publicado Hace <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ''; ?> </span>
- <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <p><?php echo string_limit_words(get_the_excerpt(), 40); ?>... <span class="seguir-leyendo"><a href="<?php the_permalink() ?>">¡Seguir Leyendo!</a></span></p>
- </div>
- </li>
- <?php endwhile; ?>
- <?php wp_reset_query(); ?>
- </ul>
- <a href="#" id="destacados_slide-prev" class="anterior"><img src="<?php bloginfo('template_directory'); ?>/images/anterior-slide.png" title="Anterior"></a>
- <a href="#" id="destacados_slide-next" class="siguiente"><img src="<?php bloginfo('template_directory'); ?>/images/siguiente-slide.png" title="Siguiente"></a>
- </div>
- ---------------------------------------------------------------------------------------------
- Configuración de jcarrousel en el header:
- ---------------------------------------------------------------------------------------------
- <script type="text/javascript">
- function destacados_slide_initCallback(carousel) {
- jQuery('#destacados_slide-next').bind('click', function() {
- carousel.next();
- return false;
- });
- jQuery('#destacados_slide-prev').bind('click', function() {
- carousel.prev();
- return false;
- });
- carousel.clip.hover(function() {
- carousel.stopAuto();
- }, function() {
- carousel.startAuto();
- });
- };
- jQuery(document).ready(function() {
- jQuery('#destacados_slide').jcarousel({
- auto: 5,
- scroll: 1,
- initCallback: destacados_slide_initCallback,
- wrap: 'circular',
- buttonNextHTML: null,
- buttonPrevHTML: null
- });
- jQuery('#video_slide').jcarousel({
- vertical: true,
- scroll: 4,
- initCallback: video_slide_initCallback,
- wrap: 'circular',
- buttonNextHTML: null,
- buttonPrevHTML: null
- });
- });
- </script>
- ---------------------------------------------------------------------------------------------
- Css:
- ---------------------------------------------------------------------------------------------
- /* Destacados Slide */
- .destacados_box {
- width: 620px;
- position: relative;
- }
- .post-destacado {
- margin-bottom: 30px;
- }
- .post-destacado h2, .post-destacado h2 a {
- font-size: 28px;
- font-family: Trebuchet MS,arial,helvetica,sans-serif;
- color: #D00000;
- line-height:1.1em;
- margin: 0 0 5px 0;
- font-weight: 600;
- }
- .post-destacado p{
- padding: 0;
- margin: 0 0 5px 0;
- font-size: 14px;
- color: #545454;
- line-height: 1.2em;
- letter-spacing: normal;
- }
- .post-destacado .imagen_principal {
- position: relative;
- margin-bottom: 7px;
- border: 0;
- }
- .post-destacado .imagen_principal a {
- display: block
- }
- .post-destacado .imagen_principal h3 {
- position: absolute;
- top: 0;
- left: 0;
- margin:0;
- }
- .post-destacado .imagen_principal h3 span a {
- color: white;
- font-size: 20px;
- font-family: 'BebasNeueRegular';
- background: #D00000; /* fallback color */
- background: #D00000;
- padding: 3px 14px;
- text-transform: uppercase;
- }
- .post-destacado .imagen_frame a {
- display:block
- }
- span.fecha-destacado {
- font-size: 11px;
- color: #929292;
- text-transform: uppercase;
- }
- span.seguir-leyendo a {
- font-weight: 600;
- color: #D00000;
- }
- /* Jcarousel */
- .jcarousel-skin-tango .jcarousel-container {
- float: left;
- }
- .jcarousel-skin-tango .jcarousel-direction-rtl {
- direction: rtl;
- }
- .jcarousel-skin-tango .jcarousel-container-horizontal {
- width: 620x;
- }
- .jcarousel-skin-tango .jcarousel-clip {
- overflow: hidden;
- }
- .jcarousel-skin-tango .jcarousel-clip-horizontal {
- width: 620px;
- }
- .jcarousel-skin-tango .jcarousel-item {
- width: 620px;
- }
- .jcarousel-skin-tango .jcarousel-item-horizontal {
- margin-left: 0;
- }
- .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal {
- margin-left: 10px;
- margin-right: 0;
- }
- .jcarousel-skin-tango .jcarousel-item-placeholder {
- background: #fff;
- color: #000;
- }
- .jcarousel-skin-tango {
- width: 274px;
- margin: 0 2px 0 0;
- }
- .jcarousel-skin-tango {
- height: 240px;
- }
- .jcarousel-skin-tango {
- width: 270px;
- height: 60px;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement