Advertisement
Guest User

Untitled

a guest
Jun 14th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.51 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * Renders the home page title (the one with the slider).
  5.  * The normal title is handled by title.php
  6.  */
  7.  
  8. $loop = new WP_Query( array( 'post_type' => 'featured_item', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order title' ) );
  9.  
  10. $featureTopEnabled = get_option(BFI_SHORTNAME.'_feature_top_enabled') == '1' ? true : false;
  11.  
  12. ?>
  13. <div class="container <?php echo $featureTopEnabled ? '' : 'cubed no-depth-top' ?> subheader preload">
  14.     <div class="headerbody">
  15.         <div id="nivoslider">
  16.             <?php
  17.        
  18.             /*
  19.              * Get the featured items and display them IF we're at the home page.
  20.              */
  21.             $i = 0;
  22.             $captions = "";
  23.             while ( $loop->have_posts() ) : $loop->the_post();
  24.        
  25.                 $slideurl = get_post_meta($post->ID, "slider_url", true);
  26.                 $displayType = get_post_meta($post->ID, "display_value", $single = true);
  27.                 $hasShadow = get_post_meta($post->ID, "shadow_value", $single = true);
  28.                
  29.                 $smallImage = get_post_meta($post->ID, "small_image_value", $single = true);
  30.                 $bigButtonText = get_post_meta($post->ID, "big_learn_more_button_value", $single = true);
  31.                 $bigButtonIcon = get_post_meta($post->ID, "big_learn_more_button_icon_value", $single = true);
  32.                 $bigButtonColor = get_post_meta($post->ID, "big_learn_more_button_color_value", $single = true);
  33.                 $bigButtonURL = get_post_meta($post->ID, "big_learn_more_button_url_value", $single = true);
  34.                 $smallButtonText = get_post_meta($post->ID, "small_learn_more_button_value", $single = true);
  35.                 $smallButtonColor = get_post_meta($post->ID, "small_learn_more_button_color_value", $single = true);
  36.                 $smallButtonURL = get_post_meta($post->ID, "small_learn_more_button_url_value", $single = true);
  37.                
  38.                 $largeImage = get_post_meta($post->ID, "large_image_value", $single = true);
  39.                 $largeImageURL = get_post_meta($post->ID, "large_image_url_value", $single = true);
  40.                 $largeImageType = get_post_meta($post->ID, "large_image_type_value", $single = true);
  41.                
  42.                 $showCaptions = get_post_meta($post->ID, "show_captions_value", $single = true);
  43.                
  44.                 $captionColor = get_post_meta($post->ID, "caption_color_value", true);
  45.                 $subcaptionColor = get_post_meta($post->ID, "subcaption_color_value", true);
  46.                
  47.                 $displayType = 'image';
  48.                 $largeImageType = 'image';
  49.                
  50.                 $sliderHeight = get_option(BFI_SHORTNAME.'_slider_height');
  51.                 $alignRight = strtolower(get_post_meta($post->ID, "caption_alignment_value", true)) == 'right';
  52.                        
  53.                 ?>
  54.                 <a href="<?php echo get_post_meta($post->ID, 'slide_url', true); ?>">
  55.                 <img src="<?php echo bfi_timthumber($largeImage, 980, (int)$sliderHeight)?>" width="980" height="<?php echo $sliderHeight ?>" title="#nivocaption<?php echo $i?>"/>
  56.                 </a>
  57.                 <?php
  58.                        
  59.                 if ($showCaptions) {
  60.                     $content = get_the_content(null, 0);
  61.                     $content = apply_filters('the_content', $content);
  62.                     $content = str_replace(']]>', ']]&gt;', $content);
  63.    
  64.                     if ($alignRight) {
  65.                         $captions .= "<div id='nivocaption$i' class='nivo-html-caption'><h1 style='color: $captionColor;' class='right'>".get_the_title()."</h1><br>";
  66.                         if ($content) {
  67.                             $captions .= "<div style='color: $subcaptionColor;' class='right'>$content</div>";
  68.                         }
  69.                         $captions .= "</div>";
  70.                     } else {
  71.                         $captions .= "<div id='nivocaption$i' class='nivo-html-caption'><h1 style='color: $captionColor'>".get_the_title()."</h1><br>";
  72.                         if ($content) {
  73.                             $captions .= "<div style='color: $subcaptionColor'>$content</div>";
  74.                         }
  75.                         $captions .= "</div>";
  76.                     }
  77.                 }
  78.                        
  79.                 $i++;
  80.             endwhile;
  81.        
  82.         ?></div><?php
  83.         echo bfi_strip_stuff($captions);
  84.            
  85.         ?>
  86.         <script type="text/javascript">if (bfi != undefined) { bfi.sliderNumContents = <?php echo $i?>; }</script>  
  87.     </div>
  88. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement