Advertisement
Guest User

gallery.php

a guest
Jul 4th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.49 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Gallery
  4. */
  5. ?>        
  6.  
  7.   <?php get_header();?>
  8.        
  9.     <script type="text/javascript">
  10.       jQuery(document).ready(function() {
  11.         jQuery("#showcase").awShowcase({
  12.             content_width:          898,
  13.             content_height:         476,
  14.             fit_to_parent:          false,
  15.             auto:                   false,
  16.             interval:               3000,
  17.             continuous:             false,
  18.             loading:                true,
  19.             tooltip_width:          200,
  20.             tooltip_icon_width:     32,
  21.             tooltip_icon_height:    32,
  22.             tooltip_offsetx:        18,
  23.             tooltip_offsety:        0,
  24.             arrows:                 false,
  25.             buttons:                false,
  26.             btn_numbers:            false,
  27.             keybord_keys:           false,
  28.             mousetrace:             false, /* Trace x and y coordinates for the mouse */
  29.             pauseonover:            true,
  30.             stoponclick:            true,
  31.             transition:             'hslide', /* hslide/vslide/fade */
  32.             transition_delay:       300,
  33.             transition_speed:       500,
  34.             show_caption:           'onhover', /* onload/onhover/show */
  35.             thumbnails:             true,
  36.             thumbnails_position:    'outside-last', /* outside-last/outside-first/inside-last/inside-first */
  37.             thumbnails_direction:   'horizontal', /* vertical/horizontal */
  38.             thumbnails_slidex:      0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
  39.             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. */
  40.             speed_change:           false, /* Set to true to prevent users from swithing more then one slide at once. */
  41.             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. */
  42.         });
  43.     });
  44.     </script>
  45.         <!-- Begin pf Page Title -->
  46.         <div id="header-inner">
  47.             <h1 class="title-page"><?php the_title();?></h1>
  48.         </div>
  49.         <!-- End of Page Title -->
  50.        
  51.         <!-- Begin of Content -->
  52.         <div id="content">
  53.             <div id="top-content">
  54.             <?php $page_description = get_post_meta($post->ID,'_page_short_desc',true);?>
  55.                 <!-- Begin of Newsflash -->
  56.                 <div id="newsflash">
  57.                 <h3><?php echo stripslashes($page_description);?></h3>
  58.               </div>
  59.                 <!-- End of Newsflash -->
  60.                
  61.               <!-- Begin of Search -->
  62.                 <div id="topsearch">
  63.                 <?php get_template_part('searchbox','tucana search box');?>    
  64.               </div>
  65.               <!-- End of Search -->
  66.                
  67.             </div>
  68.            
  69.             <div id="main-inner">
  70.            
  71.                 <!-- Begin of Gallery -->
  72.             <div id="gallery-box">
  73.               <div id="showcase" class="showcase">
  74.  
  75.  
  76.                 <?php
  77.           //get attachement count
  78.               $get_attachments = get_children( array( 'post_parent' => $post->ID ) );
  79.            
  80.             //get ID of featured image
  81.               $featured_image_id = get_post_thumbnail_id( $post->ID );
  82.            
  83.             //attachement loop
  84.             $args = array(
  85.                 'orderby' => 'menu_order',
  86.                 'post_type' => 'attachment',
  87.                 'post_parent' => get_the_ID(),
  88.                 'post_mime_type' => 'image',
  89.                 'post_status' => null,
  90.                 'posts_per_page' => -1,
  91.                 'exclude' => $featured_image_id
  92.               );
  93.               $attachments = get_posts($args);
  94.               ?>
  95.              
  96.               <?php if ($attachments) { ?>
  97.      
  98.                 <?php
  99.               foreach ($attachments as $attachment) :
  100.               //get images
  101.               $attachment_url = wp_get_attachment_url( $attachment->ID , 'full' );
  102.                 $full_image = aq_resize( $attachment_url, 898, 476, true );
  103.               $thumb_image = aq_resize( $attachment_url, 140, 94, true );
  104.               $custom_url = get_post_meta( $attachment_id, '_gallery_link_url', true );
  105.  
  106.               ?>
  107.               <div class="showcase-slide">
  108.                     <!-- Put the slide content in a div with the class .showcase-content. -->
  109.                     <div class="showcase-content">
  110.                     <a href="<?php echo $custom_url; ?>"><img src="<?php echo $full_image;?>" alt="<?php echo apply_filters('the_title', $attachment->post_title); ?>" /></a>
  111.                     </div>
  112.                     <!-- Put the thumbnail content in a div with the class .showcase-thumbnail -->
  113.                     <div class="showcase-thumbnail">
  114.                         <img src="<?php echo $thumb_image;?>" alt="<?php echo apply_filters('the_title', $attachment->post_title); ?>" />
  115.                         <!-- The div below with the class .showcase-thumbnail-caption contains the thumbnail caption. -->
  116.                         <div class="showcase-thumbnail-caption"></div>
  117.                         <!-- The div below with the class .showcase-thumbnail-cover is used for the thumbnails active state. -->
  118.                         <div class="showcase-thumbnail-cover"></div>
  119.                     </div>
  120.                     <!-- Put the caption content in a div with the class .showcase-caption -->
  121.                     <div class="showcase-caption">
  122.                         <h2><?php echo apply_filters('the_title', $attachment->post_title); ?></h2>
  123.                     </div>
  124.                 </div>
  125.               <?php endforeach;?>
  126.               <?php } ?>
  127.              </div>
  128.             </div>
  129.           </div>
  130.         </div>
  131.         <!-- End of Content -->
  132.        
  133.         <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement