Advertisement
Guest User

Untitled

a guest
May 20th, 2012
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1. <div id="slider" class="nivoSlider">
  2.     <?php
  3.         query_posts("post_type=slider&post_status=publish&posts_per_page=6");
  4.         while ( have_posts() ) : the_post();
  5.     ?>
  6.     <?php
  7.         $custom = get_post_custom($post->ID);
  8.         $url = get_post_custom_values("slider-url");
  9.         $sl_thumb = $custom["thumb"][0];
  10.         $sl_caption = $custom["caption"][0];
  11.         $sl_htmlcaption = $custom["htmlcaption"][0];
  12.     ?>
  13.   <?php if(has_post_thumbnail( $the_ID) || $sl_thumb!=""){ ?>
  14.   <?php
  15.         if($sl_thumb!=""){
  16.             echo "<a href='" . $url[0] . "'>";
  17.             echo "<img src='" . $sl_thumb . "' alt='' title='#" . $sl_caption . "' />";
  18.             echo "</a>";
  19.         } else{
  20.             echo "<a href='" . $url[0] . "'>";
  21.             the_post_thumbnail( 'slider-post-thumbnail' );
  22.             echo "</a>";
  23.         }
  24.         ?>
  25.   <?php } ?>
  26.   <?php endwhile; ?>
  27.   <?php wp_reset_query();?>
  28. </div>
  29. <?php
  30.     query_posts("post_type=slider&post_status=publish");
  31.     while ( have_posts() ) : the_post();
  32. ?>
  33. <?php
  34.     $custom = get_post_custom($post->ID);
  35.     $sl_caption = $custom["caption"][0];
  36.     $sl_htmlcaption = $custom["htmlcaption"][0];
  37. ?>
  38. <?php
  39.     echo "<div id='" . $sl_caption . "' class='nivo-html-caption'>" . $sl_htmlcaption . "</div>";
  40. ?>
  41. <?php endwhile; ?>
  42. <?php wp_reset_query();?>
  43. <a href="<?php bloginfo('url'); ?>/?page_id=72" class="button slider-button">View More</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement