File: /hosting/kak.bg/web/wp-content/themes/Primero/slider.php
<div id="showcase" class="showcase">
<?php
$args = array(
'numberposts' => 40,
'post_type' => 'portfolio',
'tax_query' => array(
array(
'taxonomy' => 'p_type',
'field' => 'slug',
'terms' => 'featured'
)
)
);
$featured_posts = get_posts($args);
if($featured_posts):
foreach($featured_posts as $post):
setup_postdata($post);
if(of_get_option('slider_type', 'full_width') == 'full_width'): ?>
<?php if(get_post_meta($post->ID, 'pyre_video_embed_link', true)): ?>
<?php
$video = get_post_meta($post->ID, 'pyre_video_embed_link', true);
$pattern = "/height=\"[0-9]*\"/";
$video = preg_replace($pattern, "height='315'", $video);
$pattern = "/width=\"[0-9]*\"/";
$video = preg_replace($pattern, "width='900'", $video);
?>
<!-- START SLIDE .showcase-slide-->
<div class="showcase-slide">
<div class="showcase-content">
<div class="full-width-slide">
<?php echo $video; ?>
</div><!-- close .full-width-slide -->
</div>
</div>
<!-- END SLIDE .showcase-slide-->
<?php elseif(has_post_thumbnail()): ?>
<!-- START SLIDE .showcase-slide-->
<div class="showcase-slide">
<div class="showcase-content">
<div class="full-width-slide">
<?php if(get_post_meta($post->ID, 'pyre_homepage_link', true)): ?>
<a href="<?php echo get_post_meta($post->ID, 'pyre_homepage_link', true); ?>"><?php the_post_thumbnail('featured-thumbnail'); ?></a>
<?php else: ?>
<a href="<?php echo get_permalink($post->ID); ?>"><?php the_post_thumbnail('featured-thumbnail'); ?></a>
<?php endif; ?>
</div><!-- close .full-width-slide -->
</div>
</div>
<!-- END SLIDE .showcase-slide-->
<?php else: ?>
<!-- START SLIDE .showcase-slide-->
<div class="showcase-slide">
<div class="showcase-content">
<div class="full-width-slide">
<?php if(get_post_meta(get_the_id(), 'pyre_video_embed_link_2', true)): ?>
<?php
$values = get_post_custom_values('pyre_video_embed_link_2');
$pattern = "/height=\"[0-9]*\"/";
$values = preg_replace($pattern, "height='315'", $values);
$pattern = "/width=\"[0-9]*\"/";
$values = preg_replace($pattern, "width='900'", $values);
$shortcode_output = do_shortcode($values[0]);
print $shortcode_output;
?>
<?php endif; ?>
</div><!-- close .full-width-slide -->
</div>
</div>
<!-- END SLIDE .showcase-slide-->
<?php endif; ?>
<?php elseif(of_get_option('slider_type', 'full_width') == 'text'): ?>
<!-- START SLIDE .showcase-slide-->
<div class="showcase-slide">
<div class="showcase-content">
<div class="slider-left">
<?php if(get_post_meta($post->ID, 'pyre_video_embed_link', true)): ?>
<?php
$video = get_post_meta($post->ID, 'pyre_video_embed_link', true);
$pattern = "/height=\"[0-9]*\"/";
$video = preg_replace($pattern, "height='315'", $video);
$pattern = "/width=\"[0-9]*\"/";
$video = preg_replace($pattern, "width='560'", $video);
?>
<?php echo $video; ?>
<?php elseif(has_post_thumbnail()): ?>
<?php if(get_post_meta($post->ID, 'pyre_homepage_link', true)): ?>
<a href="<?php echo get_post_meta($post->ID, 'pyre_homepage_link', true); ?>"><?php the_post_thumbnail('featured-thumbnail-2'); ?></a>
<?php else: ?>
<a href="<?php echo get_permalink($post->ID); ?>"><?php the_post_thumbnail('featured-thumbnail-2'); ?></a>
<?php endif; ?>
<?php else: ?>
<?php if(get_post_meta(get_the_id(), 'pyre_video_embed_link_2', true)): ?>
<?php
$values = get_post_custom_values('pyre_video_embed_link_2');
$pattern = "/height=\"[0-9]*\"/";
$values = preg_replace($pattern, "height='315'", $values);
$pattern = "/width=\"[0-9]*\"/";
$values = preg_replace($pattern, "width='560'", $values);
$shortcode_output = do_shortcode($values[0]);
print $shortcode_output;
?>
<?php endif; ?>
<?php endif; ?>
</div><!-- close .slider-left -->
<div class="slider-right">
<?php
global $more;
$more = 0;
?>
<?php if(get_post_meta($post->ID, 'pyre_homepage_link', true)): ?>
<h2><a href="<?php echo get_post_meta($post->ID, 'pyre_homepage_link', true); ?>"><?php the_title(); ?></a></h2>
<?php else: ?>
<h2><a href="<?php echo get_permalink($post->ID); ?>"><?php the_title(); ?></a></h2>
<?php endif; ?>
<div class="post-details-slider"><?php _e('Posted on','progressionstudios'); ?> <?php the_time('F d, Y'); ?></div>
<?php the_content('',FALSE,''); ?>
<?php if(has_more()) { ?>
<?php if(get_post_meta($post->ID, 'pyre_homepage_link', true)): ?>
<div class="more-link-slider"><a href="<?php echo get_post_meta($post->ID, 'pyre_homepage_link', true); ?>" class="button"><?php echo of_get_option('homepage_slider_button', 'Watch Now ›'); ?></a><span></div>
<?php else: ?>
<div class="more-link-slider"><a href="<?php the_permalink();?>" class="button"><?php echo of_get_option('homepage_slider_button', 'Watch Now ›'); ?></a>
<?php if(of_get_option('portfolio_comments', 'yes') == 'yes'): ?>
<span>or <a href="<?php the_permalink(); ?>#comments"><?php _e('Join Discussion','progressionstudios'); ?></a></span><?php endif; ?></div>
<?php endif; ?>
<?php } ?>
</div><!-- close .slider-right -->
</div>
</div>
<!-- END SLIDE .showcase-slide-->
<?php elseif(of_get_option('slider_type', 'full_width') == 'vertical'): ?>
<!-- slide start -->
<div class="showcase-slide">
<div class="showcase-content-vertical">
<?php if(get_post_meta($post->ID, 'pyre_video_embed_link', true)): ?>
<?php
$video = get_post_meta($post->ID, 'pyre_video_embed_link', true);
$pattern = "/height=\"[0-9]*\"/";
$video = preg_replace($pattern, "height='426'", $video);
$pattern = "/width=\"[0-9]*\"/";
$video = preg_replace($pattern, "width='758'", $video);
?>
<?php echo $video; ?>
<?php elseif(has_post_thumbnail()): ?>
<?php if(get_post_meta($post->ID, 'pyre_homepage_link', true)): ?>
<a href="<?php echo get_post_meta($post->ID, 'pyre_homepage_link', true); ?>"><?php the_post_thumbnail('featured-thumbnail-vertical'); ?></a>
<?php else: ?>
<a href="<?php echo get_permalink($post->ID); ?>"><?php the_post_thumbnail('featured-thumbnail-vertical'); ?></a>
<?php endif; ?>
<?php else: ?>
<?php if(get_post_meta(get_the_id(), 'pyre_video_embed_link_2', true)): ?>
<?php
$values = get_post_custom_values('pyre_video_embed_link_2');
$pattern = "/height=\"[0-9]*\"/";
$values = preg_replace($pattern, "height='426'", $values);
$pattern = "/width=\"[0-9]*\"/";
$values = preg_replace($pattern, "width='758'", $values);
$shortcode_output = do_shortcode($values[0]);
print $shortcode_output;
?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="showcase-thumbnail">
<?php if(has_post_thumbnail()): ?>
<?php the_post_thumbnail('featured-thumbnail-vertical-thumb'); ?>
<div class="showcase-thumbnail-caption"></div>
<div class="showcase-thumbnail-cover"></div>
<?php else: ?>
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => '1',
'post_status' => null,
'post_parent' => $post->ID,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$attachments = get_posts($args);
if($attachments):
foreach($attachments as $attachment):
?>
<?php $image_2 = wp_get_attachment_image_src($attachment->ID, 'featured-thumbnail-vertical-thumb'); ?>
<img src="<?php echo $image_2[0]; ?>" alt="<?php echo $attachment->post_title; ?>" />
<?php endforeach; endif; ?>
<div class="showcase-thumbnail-caption"></div>
<div class="showcase-thumbnail-cover"></div>
<?php endif; ?>
</div>
</div>
<!-- end slide -->
<?php endif;
endforeach;
endif;
?>
</div><!-- END SHOWCASE -->
<?php if(of_get_option('slider_type', 'full_width') == 'full_width' || of_get_option('slider_type', 'full_width') == 'text'): ?>
<script type="text/javascript">
jQuery(function()
{
$("#showcase").awShowcase(
{
content_width: 920,
content_height: 320,
fit_to_parent: false,
auto: <?php echo of_get_option('timer', 'true'); ?>,
interval: <?php echo of_get_option('transition', '800'); ?>,
continuous: true,
loading: true,
tooltip_width: 200,
tooltip_icon_width: 32,
tooltip_icon_height: 32,
tooltip_offsetx: 18,
tooltip_offsety: 0,
arrows: <?php echo of_get_option('arrows', 'true'); ?>,
buttons: <?php echo of_get_option('bullets', 'true'); ?>,
btn_numbers: true,
keybord_keys: true,
mousetrace: false, /* Trace x and y coordinates for the mouse */
pauseonover: true,
stoponclick: true,
transition: '<?php echo of_get_option('animation', 'fade'); ?>', /* hslide/vslide/fade */
transition_delay: 0,
transition_speed: <?php echo of_get_option('speed', '4500'); ?>,
show_caption: 'onload', /* onload/onhover/show */
thumbnails: false,
thumbnails_position: 'outside-last', /* outside-last/outside-first/inside-last/inside-first */
thumbnails_direction: 'vertical', /* vertical/horizontal */
thumbnails_slidex: 1, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
dynamic_height: false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
speed_change: true, /* Set to true to prevent users from swithing more then one slide at once. */
viewline: false, /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
custom_function: null /* Define a custom function that runs on content change */
});
});
</script>
<?php else: ?>
<script type="text/javascript">
jQuery(function()
{
$("#showcase").awShowcase(
{
content_width: 758,
content_height: 426,
fit_to_parent: false,
auto: <?php echo of_get_option('timer', 'true'); ?>,
interval: <?php echo of_get_option('transition', '800'); ?>,
continuous: false,
loading: true,
tooltip_width: 200,
tooltip_icon_width: 32,
tooltip_icon_height: 32,
tooltip_offsetx: 18,
tooltip_offsety: 0,
arrows: <?php echo of_get_option('arrows', 'true'); ?>,
buttons: <?php echo of_get_option('bullets', 'true'); ?>,
btn_numbers: true,
keybord_keys: true,
mousetrace: false, /* Trace x and y coordinates for the mouse */
pauseonover: true,
stoponclick: true,
transition: '<?php echo of_get_option('animation', 'fade'); ?>', /* hslide/vslide/fade */
transition_delay: 300,
transition_speed: <?php echo of_get_option('speed', '4500'); ?>,
show_caption: 'onload', /* onload/onhover/show */
thumbnails: true,
thumbnails_position: 'outside-last', /* outside-last/outside-first/inside-last/inside-first */
thumbnails_direction: 'vertical', /* vertical/horizontal */
thumbnails_slidex: 1, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
dynamic_height: false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
speed_change: true, /* Set to true to prevent users from swithing more then one slide at once. */
viewline: false, /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
custom_function: null /* Define a custom function that runs on content change */
});
});
</script>
<?php endif; ?>