Advertisement
sarahn

modified "Magazine – Group" template

Nov 21st, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Magazine – Group
  4. *
  5. *
  6. * @package CoLabsFramework
  7. * @subpackage Template
  8. */
  9. get_header();?>
  10. <div class="sliiide row">
  11. <?php
  12. $headline=get_option('colabs_headline');
  13. // WPML support
  14. echo "Headline category: " . $headline;
  15. function lang_category_id($id){
  16. if(function_exists('icl_object_id')) {
  17. return icl_object_id($id,'category',true);
  18. } else {
  19. return $id;
  20. }
  21. }
  22. echo "lang_category_id:<pre>"; print_r(lang_category_id($headline)); echo "</pre>";
  23. //\ WPML support
  24. query_posts('showposts=5&cat='.$headline);
  25. if ( have_posts() ):
  26. ?>
  27. <div class="column col8">
  28. <div class="box-slide">
  29. <div class="flex-container">
  30. <div class="flexslider">
  31. <ul class="slides">
  32. <?php while ( have_posts() ) : the_post(); ?>
  33. <li>
  34. <?php colabs_image('width=600&height=201&play=true&class=pic-slide');?>
  35. <div class="shadow"></div>
  36. <div class="editor">
  37. <?php
  38. $email = get_the_author_email();
  39. echo get_avatar($email,42);?>
  40. <span class="meta"><?php _e('Posted by','colabsthemes');?><br/>
  41. <?php the_author_posts_link(); ?>
  42. <hr/>
  43. <img src="<?php bloginfo("template_url")?>/images/folder-icon.png" alt="Category" class="icon" /> <?php _e('Category','colabsthemes');?> : <br/>
  44. <?php the_category(' ,');?></span>
  45. </div>
  46. <div class="post-slide">
  47. <h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
  48. <p class="meta"><img src="<?php bloginfo("template_url")?>/images/date-icon.png" alt="Category" class="icon" /> <?php the_time('F j, Y');?> | <a href="<?php comments_link(); ?>"><?php comments_number( __('Add Comment','colabsthemes'), __('1 Comment','colabsthemes'), __('% Comments','colabsthemes') ); ?></a></p>
  49. <?php colabs_custom_excerpt();?>
  50. </div>
  51. </li>
  52. <?php endwhile; ?>
  53.  
  54. </ul>
  55. </div><!– .flexslider –>
  56. </div><!– .flex-container –>
  57. </div>
  58. <div class="shadow-slide"></div>
  59. </div>
  60. <?php endif;?>
  61.  
  62. <div class="column col4">
  63.  
  64. <?php
  65. /* Tabs Widget */
  66. $tabs = new CoLabs_Tabs();
  67. $args = array(
  68. 'before_title' => '',
  69. 'after_title' => '',
  70. 'before_widget' => '<div class="widget_colabs_tabs">',
  71. 'after_widget' => '</div>'
  72. );
  73.  
  74. $instance = array(
  75. 'number' => 4,
  76. 'thumb_size' => 62
  77. );
  78. $tabs->widget( $args, $instance );
  79. ?>
  80. <!– /widget colabsTabs –>
  81. </div><!– /column row –>
  82. </div><!– /sliiide –>
  83.  
  84. <?php
  85. $highlight=get_option('colabs_highlight');
  86. $count=count($highlight);
  87. if ($highlight){
  88. ?>
  89. <div class="highlights row">
  90.  
  91. <?php
  92. $postnotin=array();
  93. for($i=0;$i<$count;$i++){
  94. query_posts('showposts=1&category__in='.$highlight[$i]);
  95. while ( have_posts() ) : the_post();
  96. ?>
  97. <div class="column col3">
  98. <div class="hlight-post">
  99. <p class="cat"><?php the_category(' ,');?><br/>
  100. <span class="date"><?php the_time('j F Y');?></span></p>
  101. <a href="<?php the_permalink();?>"><?php colabs_image('width=340&height=234&play=true');?></a>
  102. <h2><a href="<?php the_permalink();?>"><?php the_title();?></h2></a>
  103. </div>
  104. </div>
  105. <?php
  106. $postnotin[]=$post->ID;
  107. endwhile;
  108. }
  109. ?>
  110.  
  111. </div><!– /highlight –>
  112. <?php }?>
  113. <div class="main row magazine-group">
  114.  
  115. <div class="content <?php if(get_option('colabs_layout_settings')=='two-col-right'){echo 'fr';}else{?>column<?php }?> col8">
  116.  
  117. <?php
  118. $categories = get_categories('orderby=order&echo=0&style=none&exclude='.$headline);
  119. foreach ($categories as $item) :
  120. ?>
  121.  
  122. <div class="cat-group row"><h3 class="cat-title"><?php echo $item->name; ?></h3>
  123.  
  124. <?php
  125. $postslist = query_posts( array (
  126. 'category_name' => $item->slug,
  127. 'numberposts' => 5,
  128. 'post__not_in' => $postnotin,
  129. 'paged' => $paged
  130. ));
  131. $count = 0;?>
  132.  
  133. <div class="post clearfix">
  134.  
  135. <?php
  136. foreach ($postslist as $post) :
  137. $count++;
  138. ?>
  139.  
  140. <?php if( $count == 1 ){ ?>
  141.  
  142. <div class="column col3">
  143. <?php colabs_image('width=130&height=83&play=true&class=img-feat');?>
  144. <p class="entry-meta">
  145. <?php the_time('j F Y');?> <img src="<?php bloginfo("template_url")?>/images/date-icon.png" alt="" /><br/>
  146. <?php the_author_posts_link(); ?> <img src="<?php bloginfo("template_url")?>/images/author-icon.png" alt="" /><br/>
  147. <?php the_category(' ,');?><img src="<?php bloginfo("template_url")?>/images/folder-icon.png" alt="" /><br/>
  148. </p>
  149. </div>
  150. <div class="column col9">
  151. <h2 class="entry-header"><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
  152. <div class="entry-content">
  153. <?php colabs_custom_excerpt();?>
  154. </div>
  155. </div>
  156. <div class="clear"></div>
  157.  
  158. <?php }else{ ?>
  159.  
  160. <div class="related clearfix">
  161. <div class="column col3">
  162. <p class="entry-meta"><?php the_time('j F Y');?></p>
  163. </div>
  164. <div class="column col9">
  165. <h4 class="entry-header"><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
  166. </div>
  167. </div>
  168.  
  169. <?php } ?>
  170.  
  171. <?php
  172. endforeach;
  173. ?>
  174.  
  175. </div><!– .post –>
  176.  
  177. </div><!– .cat-group –>
  178.  
  179. <?php
  180. endforeach;
  181. ?>
  182.  
  183. <!– Gunakan struktur html ini untuk membuat pagination –>
  184. <?php colabs_pagination();?><!– .pagination –>
  185. <?php //else: ?>
  186.  
  187. <!–div class="post">
  188. <h2><?php _e('No posts found. Try a different search?','colabsthemes');?></h2>
  189. </div–>
  190.  
  191. <?php //endif;?>
  192.  
  193. </div>
  194.  
  195. <?php get_sidebar();?><!– .sidebar –>
  196.  
  197. <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement