function markplan_carousel() { $read_more = __('Read more', 'wp-parallax-content-slider'); $categoria = 'destacados'; $params = array('post_type' => 'wpdmpro', 'posts_per_page' => 10); if (isset($categoria)) { $params['tax_query'] = array(array('taxonomy' => 'wpdmcategory', 'field' => 'slug', 'terms' => array($categoria))); } $packs = get_posts($params); foreach ($packs as $file) { ?> <div class="da-slide"> <h2><a href="<?php echo get_permalink($file->ID); ?> "><?php echo $file->post_title; ?> </a></h2> <p><a href="<?php echo get_permalink($file->ID); ?> "><?php echo $file->post_content; ?> </a></p> <a href="<?php echo get_permalink($file->ID); ?> " class="da-link"><?php echo $read_more; ?> </a> <div class="da-img"><a href="<?php echo get_permalink($file->ID); ?> "><?php wpdm_thumb($file->ID, array(300, 200)); ?> </a> </div> </div> <?php } }
function wpdm_carousel($params = array()) { if (is_array($params)) { extract($params); } if (isset($category)) { $cat = get_term_by('slug', $category, 'wpdmcategory'); } ob_start(); ?> <div class="w3eden" style="padding:10px;border:1px solid #bbb;border-radius:4px;"> <div class="row"> <div class="col-md-12"> <h3 style="line-height: normal;margin: 0px;float:left;"> <span style="border-bottom:3px double #3399ff;padding-bottom: 8px;float:left;display: block;margin-bottom: -3px"> <?php echo isset($category) ? $cat->name : 'New Downloads'; ?> </span> </h3> <div class="pull-right"> <a class="btn btn-sm btn-inverse btn-transparent" href="#myCarousel1" data-slide="prev"><i class="fa fa-white fa-chevron-left"></i></a> <a class="btn btn-sm btn-inverse btn-transparent" href="#myCarousel1" data-slide="next"><i class="fa fa-white fa-chevron-right"></i></a> <?php if (isset($category)) { ?> <a class="btn btn-mini btn-inverse btn-transparent" title='View All' href="<?php echo get_term_link($cat); ?> " data-slide="next"><i class="fa fa-white fa-th"></i> </a><?php } ?> </div> <div style="clear:both;border-top:3px double #888;margin: -3px 0 10px 0"></div> </div> </div> <div id="myCarousel1" class="carousel slide"> <!--<ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ol>--> <!-- Carousel items --> <div class="carousel-inner"> <div class="active item"> <div class="row"> <?php $params = array('post_type' => 'wpdmpro', 'posts_per_page' => 4); if (isset($category)) { $params['tax_query'] = array(array('taxonomy' => 'wpdmcategory', 'field' => 'slug', 'terms' => array($category))); } $packs = get_posts($params); foreach ($packs as $file) { ?> <div class="col-md-3"> <figure class="rift"> <?php wpdm_thumb($file->ID, array(300, 200)); ?> <figcaption class="caption"><a href='<?php echo get_permalink($file->ID); ?> '><?php echo $file->post_title; ?> </a> </figcaption> </figure> </div> <?php } ?> </div> </div> <div class="item"> <div class="row"> <?php $params = array('post_type' => 'wpdmpro', 'offset' => 4, 'posts_per_page' => 4); if (isset($category)) { $params['tax_query'] = array(array('taxonomy' => 'wpdmcategory', 'field' => 'slug', 'terms' => array($category))); } $packs = get_posts($params); foreach ($packs as $file) { ?> <div class="col-md-3"> <figure class="rift"> <?php wpdm_thumb($file->ID, array(300, 200)); ?> <figcaption class="caption"><a href='<?php echo get_permalink($file->ID); ?> '><?php echo $file->post_title; ?> </a> </figcaption> </figure> </div> <?php } ?> </div> </div> </div> </div> </div> <style> .carousel-control { border-radius: 0 !important; border: 0 !important; background: rgba(30, 96, 158, 0.8); padding: 10px 5px 18px 5px; } /* Base plugin styles */ .rift { position: relative; overflow: hidden; backface-visibility: hidden; border-radius: 3px; } .rift img { width: 100%; height: auto; opacity: 0; } .rift .caption { position: absolute; top: 50%; width: 100%; height: 60px; /* Define caption height */ line-height: 60px; /* Define matched line-height */ margin: -30px 0 0 0; /* Half caption height */ text-align: center; z-index: 0; } .rift span[class*="span"] { display: block; width: 100%; height: 50%; overflow: hidden; position: absolute; left: 0; z-index: 1; transform: translate3d(0, 0, 0); /* Acceleration FTW */ transition: transform .25s; /* Define anim. speed */ } .rift span.top-span { top: 0; } .rift span.btm-span { bottom: 0; } .rift:hover span.top-span { transform: translate(0, -30px); /* Half caption height */ } .rift:hover > span.btm-span { transform: translate(0, 30px); /* Half caption height */ } /* Non-plugin styles */ .rift { display: inline-block; cursor: pointer; } .rift .caption { color: #ffffff; background: #52B77C; } .rift .caption a { color: #ffffff; font-weight: bold; } </style> <script> jQuery(function ($) { $('#myCarousel1').carousel(); }); /** * Rift v1.0.0 * An itsy bitsy image-splitting jQuery plugin * * Licensed under the MIT license. * Copyright 2013 Kyle Foster @hkfoster */ ; (function ($, window, document, undefined) { $.fn.rift = function () { return this.each(function () { // Vurribles var element = $(this), elemImg = element.find('img'), imgSrc = elemImg.attr('src'); // We be chainin' element .prepend('<span class="top-span"></span>') .append('<span class="btm-span"></span>') .find('span.top-span') .css('background', 'url(' + imgSrc + ') no-repeat center top') .css('background-size', '100%') .parent() .find('span.btm-span') .css('background', 'url(' + imgSrc + ') no-repeat center bottom') .css('background-size', '100%'); }); }; })(jQuery, window, document); jQuery('.rift').rift(); </script> <?php $data = ob_get_clean(); return $data; }