Guest User

Untitled

a guest
Jul 7th, 2011
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. <?php
  2.  
  3. global $post;
  4. $featured_cat = get_option('CT_featured_cat');
  5. $featured_id = get_cat_ID($featured_cat);
  6. $featured_num = get_option('CT_featured_number');
  7. $featured_numtext = (get_option('CT_numtext')) ? get_option('CT_numtext') : 30;
  8. $slideshow_alt = get_option('CT_slideshow_alt');
  9. $slidetext_position = get_option('CT_slidetext_position');
  10.  
  11. if ($slideshow_alt == "true") {
  12. ?>
  13. <div id="slider">
  14. <?php
  15. $featured_slide = new WP_Query('cat='.$featured_id.'&showposts='.$featured_num);
  16. while ($featured_slide->have_posts()): $featured_slide->the_post();
  17. $image_thumbnail = get_post_meta($post->ID, '_image_thumbnail', true );
  18. ?>
  19. <?php if ($image_thumbnail) { ?>
  20. <a href="<?php the_permalink();?>">
  21. <img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php echo $image_thumbnail;?>&amp;h=280&amp;w=960&amp;zc=1" alt="<?php the_title();?>" title="<?php echo excerpt($featured_numtext);?>"/>
  22. </a>
  23. <?php
  24. } else { ?>
  25. <?php if (get_post_meta($post->ID,"thumbnail",true)) { ?>
  26. <a href="<?php the_permalink();?>">
  27. <img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php echo get_post_meta($post->ID,"thumbnail",true);?>&amp;h=280&amp;w=960&amp;zc=1" alt="<?php the_title();?>" title="<?php echo excerpt($featured_numtext);?>"/>
  28. </a>
  29. <?php } ?>
  30. <?php } ?>
  31. <?php endwhile;
  32. ?>
  33. </div>
  34. <?php
  35. } else { ?>
  36. <div id="slider1">
  37. <ul id="slider1Content">
  38. <?php
  39. $featured_slide = new WP_Query('cat='.$featured_id.'&showposts='.$featured_num);
  40. while ($featured_slide->have_posts()): $featured_slide->the_post();
  41. $image_thumbnail = get_post_meta($post->ID, '_image_thumbnail', true );
  42. ?>
  43.  
  44. <li class="slider1Image">
  45. <?php if ($image_thumbnail) { ?>
  46. <a href="<?php the_permalink();?>"><img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php echo $image_thumbnail;?>&amp;h=280&amp;w=960&amp;zc=1" alt="<?php the_title(); ?>"/></a>
  47. <?php
  48. } else { ?>
  49. <?php if (get_post_meta($post->ID,"thumbnail",true)) { ?>
  50. <a href="<?php the_permalink();?>"><img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php echo get_post_meta($post->ID,"thumbnail",true);?>&amp;h=280&amp;w=960&amp;zc=1" alt="<?php the_title(); ?>"/></a>
  51. <?php } else { ?>
  52. <img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php bloginfo('template_directory');?>/images/nothumbnail.jpg&amp;h=280&amp;w=960&amp;zc=1" alt="<?php the_title(); ?>"/>
  53. <?php }?>
  54. <?php }?>
  55. <span
  56. <?php
  57. switch ($slidetext_position) {
  58. case "right": echo 'class="right"';
  59. break;
  60. case "left": echo 'class="left"';
  61. break;
  62. case "top": echo 'class="top"';
  63. break;
  64. case "bottom": echo 'class="bottom"';
  65. break;
  66. default: echo 'class="bottom"';
  67. }
  68. ?>
  69. >
  70. <strong><?php the_title();?></strong>
  71. <div class="clr"></div><?php if ($slidetext_position == "left" || $slidetext_position == "right") echo '<br />';?>
  72. <p><?php excerpt($featured_numtext);?></p>
  73. <div class="clr"></div>
  74. <?php if ($slidetext_position == "left" || $slidetext_position == "right"): ?>
  75. <a href="<?php the_permalink();?>" class="more"><?php echo __('read more','centita');?></a>
  76. <?php endif;?>
  77. </span>
  78. </li>
  79. <?php endwhile;?>
  80. <?php wp_reset_query();?>
  81. <div class="clear slider1Image"></div>
  82. </ul>
  83. </div>
  84. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment