Advertisement
Guest User

Untitled

a guest
Mar 20th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <?php
  2. $featured_on = get_theme_option('slider_on');
  3. $featured_category = get_theme_option('feat_cat');
  4. $featured_number = get_theme_option('feat_cat_count');
  5. $featured_post = get_theme_option('feat_post');
  6. ?>
  7.  
  8. <?php if($featured_on == 'Enable'): ?>
  9. <!-- SSLIDER -->
  10. <div id="slider">
  11. <ul id="sliderContent">
  12.  
  13. <?php if(!$featured_category && !$featured_post): ?>
  14.  
  15. <?php else: ?>
  16.  
  17. <?php if($featured_category): ?>
  18.  
  19. <?php
  20. $post_count = 1;
  21. $arraypost = array('left','right');
  22. $query = new WP_Query( "cat=$featured_category&posts_per_page=$featured_number&orderby=date" );
  23. while ( $query->have_posts() ) : $query->the_post();
  24. $inputpost = array_rand($arraypost,1);
  25. $theposition = $arraypost[$inputpost];
  26. ?>
  27.  
  28. <li class="sliderImage">
  29. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  30. <?php echo get_featured_post_image("", "", 640, 480, "alignnone", "full", $post_count ,get_the_title(), true); ?>
  31. </a>
  32. <span class="<?php echo $theposition; ?>">
  33. <h1><?php the_title(); ?></h1>
  34. <p><?php get_the_featured_excerpt($excerpt_length=70); ?></p>
  35. </span>
  36. </li>
  37.  
  38. <?php $post_count++; endwhile; wp_reset_query(); ?>
  39.  
  40.  
  41. <?php elseif($featured_post && !$featured_category): ?>
  42.  
  43. <?php
  44. $post_count = 1;
  45. $arraypost = array('left','right');
  46. query_posts( array( 'post__in' => explode(',', $featured_post), 'post_type'=> array('post','portfolio'), 'posts_per_page' => 100, 'orderby' => 'date', 'order' => 'DESC' ) );
  47. while ( have_posts() ) : the_post();
  48. $inputpost = array_rand($arraypost,1);
  49. $theposition = $arraypost[$inputpost];
  50. ?>
  51.  
  52. <li class="sliderImage">
  53. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  54. <?php echo get_featured_post_image("", "", 640, 480, "alignleft", "full", $post_count ,get_the_title(), true); ?>
  55. </a>
  56. <span class="<?php echo $theposition; ?>">
  57. <h1><?php the_title(); ?></h1>
  58. <p><?php get_the_featured_excerpt($excerpt_length=70); ?></p>
  59. </span>
  60. </li>
  61.  
  62. <?php $post_count++; endwhile; echo '<li class="sliderImage"></li>'; wp_reset_query(); ?>
  63.  
  64. <?php endif; ?>
  65.  
  66. <?php endif; ?>
  67.  
  68. </ul>
  69. </div>
  70. <!-- // END SSLIDER -->
  71.  
  72. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement