Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Renders the home page title (the one with the slider).
- * The normal title is handled by title.php
- */
- $loop = new WP_Query( array( 'post_type' => 'featured_item', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order title' ) );
- $featureTopEnabled = get_option(BFI_SHORTNAME.'_feature_top_enabled') == '1' ? true : false;
- ?>
- <div class="container <?php echo $featureTopEnabled ? '' : 'cubed no-depth-top' ?> subheader preload">
- <div class="headerbody">
- <div id="nivoslider">
- <?php
- /*
- * Get the featured items and display them IF we're at the home page.
- */
- $i = 0;
- $captions = "";
- while ( $loop->have_posts() ) : $loop->the_post();
- $slideurl = get_post_meta($post->ID, "slider_url", true);
- $displayType = get_post_meta($post->ID, "display_value", $single = true);
- $hasShadow = get_post_meta($post->ID, "shadow_value", $single = true);
- $smallImage = get_post_meta($post->ID, "small_image_value", $single = true);
- $bigButtonText = get_post_meta($post->ID, "big_learn_more_button_value", $single = true);
- $bigButtonIcon = get_post_meta($post->ID, "big_learn_more_button_icon_value", $single = true);
- $bigButtonColor = get_post_meta($post->ID, "big_learn_more_button_color_value", $single = true);
- $bigButtonURL = get_post_meta($post->ID, "big_learn_more_button_url_value", $single = true);
- $smallButtonText = get_post_meta($post->ID, "small_learn_more_button_value", $single = true);
- $smallButtonColor = get_post_meta($post->ID, "small_learn_more_button_color_value", $single = true);
- $smallButtonURL = get_post_meta($post->ID, "small_learn_more_button_url_value", $single = true);
- $largeImage = get_post_meta($post->ID, "large_image_value", $single = true);
- $largeImageURL = get_post_meta($post->ID, "large_image_url_value", $single = true);
- $largeImageType = get_post_meta($post->ID, "large_image_type_value", $single = true);
- $showCaptions = get_post_meta($post->ID, "show_captions_value", $single = true);
- $captionColor = get_post_meta($post->ID, "caption_color_value", true);
- $subcaptionColor = get_post_meta($post->ID, "subcaption_color_value", true);
- $displayType = 'image';
- $largeImageType = 'image';
- $sliderHeight = get_option(BFI_SHORTNAME.'_slider_height');
- $alignRight = strtolower(get_post_meta($post->ID, "caption_alignment_value", true)) == 'right';
- ?>
- <a href="<?php echo get_post_meta($post->ID, 'slide_url', true); ?>">
- <img src="<?php echo bfi_timthumber($largeImage, 980, (int)$sliderHeight)?>" width="980" height="<?php echo $sliderHeight ?>" title="#nivocaption<?php echo $i?>"/>
- </a>
- <?php
- if ($showCaptions) {
- $content = get_the_content(null, 0);
- $content = apply_filters('the_content', $content);
- $content = str_replace(']]>', ']]>', $content);
- if ($alignRight) {
- $captions .= "<div id='nivocaption$i' class='nivo-html-caption'><h1 style='color: $captionColor;' class='right'>".get_the_title()."</h1><br>";
- if ($content) {
- $captions .= "<div style='color: $subcaptionColor;' class='right'>$content</div>";
- }
- $captions .= "</div>";
- } else {
- $captions .= "<div id='nivocaption$i' class='nivo-html-caption'><h1 style='color: $captionColor'>".get_the_title()."</h1><br>";
- if ($content) {
- $captions .= "<div style='color: $subcaptionColor'>$content</div>";
- }
- $captions .= "</div>";
- }
- }
- $i++;
- endwhile;
- ?></div><?php
- echo bfi_strip_stuff($captions);
- ?>
- <script type="text/javascript">if (bfi != undefined) { bfi.sliderNumContents = <?php echo $i?>; }</script>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement