wp_blog/wp-content/themes/New folder/download/pk2012_sold/format-page-slider.php

67 lines
3.2 KiB
PHP
Raw Normal View History

2020-01-02 23:15:16 +07:00
<?php
$post_meta = get_post_custom(get_the_ID());
$post_images = pk_get_post_gallery_images(((is_page_template('page-full-width.php')) ? 'full-width' : 'big'));
$post_images_full = pk_get_post_gallery_images('full');
?>
<div id="pk_slider_<?php the_ID(); ?>" class="pk_slider">
<div class="pk_slider_content">
<?php
for ($i = 0; $i < count($post_images); $i++) :
$video_url = get_post_meta($post_images[$i]['id'], '_video_url', true);
$image_link = get_post_meta($post_images[$i]['id'], '_image_link', true);
$image_link_target = get_post_meta($post_images[$i]['id'], '_image_link_target', true);
?>
<div class="pk_slider_item">
<div class="pk_slider_item_media">
<div class="pk_image">
<div class="pk_image_wrapper<?php echo ($video_url) ? ' pk_play_icon' : (($image_link)? ' pk_link_icon' : ' pk_zoom_icon'); ?>">
<a <?php if (!$image_link) : ?>class="prettyPhoto<?php echo the_ID(); ?>" <?php endif; ?>href="<?php if ($image_link) : echo esc_url($image_link); else : echo ($video_url) ? esc_url($video_url) : $post_images_full[$i]['url']; endif; ?>"<?php echo ($image_link_target) ? ' target="'.$image_link_target.'"' : ' target="_self"'; ?> title="<?php echo $post_images[$i]['description']; ?>">
<?php echo $post_images[$i]['img']; ?>
<span class="pk_image_button_back_ground"></span>
<span class="pk_image_button_icon"></span>
</a>
</div>
</div>
</div>
<?php
if ($post_images[$i]['description']) :
?>
<div class="pk_slider_item_info">
<div class="pk_slider_item_info_background"></div>
<div class="pk_slider_item_info_content"><?php echo $post_images[$i]['description']; ?></div>
</div>
<?php
endif;
?>
</div>
<?php
endfor;
?>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".prettyPhoto<?php the_ID(); ?>").attr('rel', 'prettyPhoto[gallery_<?php the_ID(); ?>]').prettyPhoto(<?php echo PK_PRETTYPHOTO_PARAMS; ?>);
jQuery("#pk_slider_<?php the_ID(); ?>").pk_slider({
sliderWidth:580,
sliderHeight:0,
buttonInfoOpenLabel:"<?php echo (isset($post_meta['_slider_info_button_open_label'][0])) ? $post_meta['_slider_info_button_open_label'][0] : __('info', 'pk_translate'); ?>",
buttonInfoCloseLabel:"<?php echo (isset($post_meta['_slider_info_button_close_label'][0])) ? $post_meta['_slider_info_button_close_label'][0] : __('close info', 'pk_translate'); ?>",
infoTextAlign:"left",
infoBackgroundAlpha:0.9,
slideshow:<?php echo (isset($post_meta['_slider_slideshow'][0])) ? $post_meta['_slider_slideshow'][0] : 'true'; ?>,
slideshowAutoStart:<?php echo (isset($post_meta['_slider_slideshow_auto_start'][0])) ? $post_meta['_slider_slideshow_auto_start'][0] : 'false'; ?>,
slideshowInterval:<?php echo (isset($post_meta['_slider_slideshow_interval'][0])) ? $post_meta['_slider_slideshow_interval'][0] : '5'; ?>,
easing: "easeOutExpo",
speedIn:400,
speedOut:400
});
});
</script>
<?php
add_filter('embed_defaults', 'pk_page_embed_defaults'); the_content();
?>