Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. <?php get_header();
  2.  
  3. // this outputs the headline on your mainpage within an h2 tag
  4. if($k_option['general']['headline'] != '')
  5. {
  6. echo '<div id="feature_info">';
  7. echo '<h2>'.$k_option['general']['headline'].'</h2>';
  8. echo '</div>';
  9. }
  10.  
  11.  
  12. //start the loop that generates the entries
  13. $loopcount = 0;
  14. $additional_loop = new WP_Query("paged=$paged&cat=".$k_option['gallery']['gallery_cat_final']."&posts_per_page=".$k_option['gallery']['post_count']);
  15.  
  16.  
  17. echo '<div id="main">';
  18. echo '<div class="content the_gallery">';
  19.  
  20. if ($additional_loop->have_posts()) :
  21. while ($additional_loop->have_posts()) : $additional_loop->the_post();
  22.  
  23. //here starts the code generated for each gallery entry:
  24. if ($loopcount === 0) echo '<div class="entry">';
  25. $loopcount ++;
  26. $last = $loopcount === 2 ? 'last': '';
  27.  
  28. $postlink = get_permalink(); //internal post link
  29. $external = get_post_meta($post->ID, "_external", true); //external link from customfield
  30. $featured = get_post_meta($post->ID, "_prev_featured", true); //check if post gets a featured badge
  31.  
  32. //set link for postimage depending on the backend option settings
  33. $imagelink = $k_option['gallery']['image_link'] == 'permalink' ? $postlink : $external;
  34.  
  35.  
  36. //set link for posttitle depending on the backend option settings
  37. $titlelink = $k_option['gallery']['name_link'] == 'permalink' ? $postlink : $external;
  38.  
  39. //get the images for the gallery entry, small and big size at a time
  40. $small_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('M','_preview_medium'),
  41. 'wh' => $k_option['custom']['imgSize']['M'],
  42. 'img_attr' => array('class'=>'item_small')
  43. ));
  44.  
  45.  
  46. $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('L'),
  47. 'wh' => $k_option['custom']['imgSize']['L'],
  48. 'img_attr' => array('class'=>'item_big no_preload')
  49. ));
  50.  
  51.  
  52. //output the entry with all the parameters gathered above
  53. echo "<div class='gallery_entry gallery_entry_$loopcount $last'>";
  54. echo "<div class='gallery_inner'>";
  55. echo "<a class='gallery_image' href='".$imagelink."'>";
  56. if($featured == 'yes') echo "<span class='featured_entry'></span>";
  57. echo $small_prev_image;
  58. echo $big_prev_image;
  59. echo "</a>";
  60.  
  61. if(function_exists('the_ratings')) the_ratings();
  62. echo "<div class='gallery_excerpt'>";
  63. echo get_the_excerpt();
  64. echo "</div>";
  65. echo "</div>";
  66. echo "<h3><a href='".$titlelink."'>".get_the_title()."</a></h3>"; ?>
  67. <a href="<?php $values = get_post_custom_values("demolink"); echo $values[0]; ?>" class="fl" rel="nofollow" target="_blank">Demo</a>
  68. <?php echo "</div>";
  69.  
  70.  
  71. if($loopcount == 2)
  72. {
  73. $loopcount = 0;
  74. echo '</div>';
  75. }
  76. endwhile;
  77. if($loopcount !== 0) echo'</div>';
  78. endif;
  79.  
  80.  
  81. kriesi_pagination($additional_loop->max_num_pages);
  82. #end content
  83. echo '</div>';
  84.  
  85. $k_option['showSidebar'] = 'frontpage';
  86. get_sidebar();
  87.  
  88. get_footer();
  89. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement