Guest User

Untitled

a guest
Jan 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. <?php global $ids; ?>
  2. <?php
  3. $ids = array();
  4. $arr = array();
  5. $i=1;
  6.  
  7. $width = 177;
  8. $height = 177;
  9.  
  10. $width2 = 35;
  11. $height2 = 35;
  12.  
  13. $featured_cat = get_option('polished_feat_cat');
  14. $featured_num = get_option('polished_featured_num');
  15.  
  16. if (get_option('polished_use_pages') == 'false') query_posts("showposts=$featured_num&cat=".get_catId($featured_cat));
  17. else {
  18. global $pages_number;
  19. if (get_option('polished_feat_pages') <> '') $featured_num = count(get_option('polished_feat_pages'));
  20. else $featured_num = $pages_number;
  21.  
  22. query_posts(array
  23. ('post_type' => 'page',
  24. 'orderby' => 'menu_order',
  25. 'order' => 'ASC',
  26. 'post__in' => get_option('polished_feat_pages'),
  27. 'showposts' => $featured_num
  28. ));
  29. };
  30.  
  31. while (have_posts()) : the_post();
  32.  
  33. $arr[$i]["title"] = truncate_title(22,false);
  34. $arr[$i]["title2"] = truncate_title(25,false);
  35. $arr[$i]["fulltitle"] = truncate_title(250,false);
  36. $arr[$i]["excerpt"] = truncate_post(345,false);
  37. $arr[$i]["permalink"] = get_permalink();
  38. $arr[$i]["postinfo"] = __("Posted by", "Polished")." ". get_the_author_meta('display_name') . __(' on ','Polished') . get_the_time(get_option('polished_date_format'));
  39.  
  40. $arr[$i]["thumbnail"] = get_thumbnail($width,$height,'featured_img',$arr[$i]["fulltitle"]);
  41. $arr[$i]["thumb"] = $arr[$i]["thumbnail"]["thumb"];
  42. $arr[$i]["use_timthumb"] = $arr[$i]["thumbnail"]["use_timthumb"];
  43.  
  44. $arr[$i]["thumbnail2"] = get_thumbnail($width2,$height2,'',$arr[$i]["fulltitle"]);
  45. $arr[$i]["thumb2"] = $arr[$i]["thumbnail2"]["thumb"];
  46.  
  47. $i++;
  48. $ids[]= $post->ID;
  49. endwhile; wp_reset_query(); ?>
  50.  
  51. <!-- Start Featured -->
  52. <div id="featured">
  53. <div id="left_arrow"><a href="#" id="previous"><img src="<?php bloginfo('template_directory'); ?>/images/fleft_arrow.png" width="32" height="70" alt="Featured Previous"/></a></div>
  54.  
  55. <!-- Featured Content -->
  56. <div id="featured_content">
  57.  
  58. <!-- Featured Articles -->
  59. <div id="spotlight">
  60. <?php if ($featured_num > 4) $featured_num=4;
  61. for ($i = 1; $i <= $featured_num; $i++) { ?>
  62. <div class="slide">
  63. <h1><?php echo $arr[$i]["title"]; ?></h1>
  64. <br class="clear" />
  65. <?php print_thumbnail($arr[$i]["thumb"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"] , $width, $height,'featured_img'); ?>
  66. <?php echo $arr[$i]["excerpt"]; ?>
  67.  
  68. <span class="readmore_g"><a href="<?php echo $arr[$i]["permalink"]; ?>"> <?php _e('Read More','Polished') ?></a></span>
  69. </div>
  70. <?php }; ?>
  71. </div>
  72. <!-- End Featured Articles -->
  73.  
  74. <!-- Featured Menu -->
  75. <div id="f_menu">
  76. <?php for ($i = 1; $i <= $featured_num; $i++) { ?>
  77. <div class="featitem<?php if ($i==1) echo ' active'; if ($i==$featured_num) echo ' last'; ?>">
  78. <?php print_thumbnail($arr[$i]["thumb2"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"] , $width2, $height2); ?>
  79. <h2><?php echo $arr[$i]["title2"]; ?></h2>
  80. <span class="meta"><?php echo $arr[$i]["postinfo"]; ?></span>
  81. <span class="order"><?php echo $i; ?></span>
  82. </div>
  83. <?php }; ?>
  84. </div>
  85. <!-- End Featured Menu -->
  86. </div>
  87. <!-- End Featured Content -->
  88.  
  89. <div id="right_arrow"><a href="#" id="next"><img src="<?php bloginfo('template_directory'); ?>/images/fright_arrow.png" width="32" height="70" alt="Featured Next"/></a></div>
  90. </div>
  91. <!-- End Featured -->
Add Comment
Please, Sign In to add comment