Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 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 === 3 ? '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. $wordpress = get_post_meta($post->ID, "wordpress", true); //check if post has a wordpress mark
  32. $joomla = get_post_meta($post->ID, "joomla", true); //check if post has a joomla mark
  33. $magento = get_post_meta($post->ID, "magento", true); //check if post has a magento mark
  34. $drupal = get_post_meta($post->ID, "drupal", true); //check if post has a drupal mark
  35. $child = get_post_meta($post->ID, "child", true); //check if post has a child mark
  36.  
  37. //set link for postimage depending on the backend option settings
  38. $imagelink = $k_option['gallery']['image_link'] == 'permalink' ? $postlink : $external;
  39.  
  40.  
  41. //set link for posttitle depending on the backend option settings
  42. $titlelink = $k_option['gallery']['name_link'] == 'permalink' ? $postlink : $external;
  43.  
  44. //get the images for the gallery entry, small and big size at a time
  45. $small_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('M','_preview_medium'),
  46. 'wh' => $k_option['custom']['imgSize']['M'],
  47. 'img_attr' => array('class'=>'item_small')
  48. ));
  49.  
  50.  
  51. $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('L'),
  52. 'wh' => $k_option['custom']['imgSize']['L'],
  53. 'img_attr' => array('class'=>'item_big no_preload')
  54. ));
  55.  
  56.  
  57. //output the entry with all the parameters gathered above
  58. echo "<div class='gallery_entry gallery_entry_$loopcount $last'>";
  59. echo "<div class='gallery_inner'>";
  60. echo "<a class='preloading gallery_image' href='".$imagelink."'>";
  61. if($featured == 'yes') echo "<span class='featured_entry'></span>";
  62. if($wordpress == '1') echo "<span class='featured_entry wordpress'></span>";
  63. if($joomla == '1') echo "<span class='featured_entry joomla'></span>";
  64. if($magento == '1') echo "<span class='featured_entry magento'></span>";
  65. if($drupal == '1') echo "<span class='featured_entry drupal'></span>";
  66. if($child == '1') echo "<span class='featured_entry child'></span>";
  67. echo $small_prev_image;
  68. echo $big_prev_image;
  69. echo "</a>";
  70. echo "<span class='comment_link'>";
  71. comments_popup_link(__('0','expose'), __('1','expose'), __('%','expose'));
  72. echo "</span>";
  73. if(function_exists('the_ratings')) the_ratings();
  74. echo "<div class='gallery_excerpt'>";
  75. echo get_the_excerpt();
  76. echo "</div>";
  77. echo "</div>";
  78. echo "<h3><a href='".$titlelink."'>".get_the_title()."</a></h3>";
  79. echo "</div>";
  80.  
  81.  
  82. if($loopcount == 3)
  83. {
  84. $loopcount = 0;
  85. echo '</div>';
  86. }
  87. endwhile;
  88. if($loopcount !== 0) echo'</div>';
  89. endif;
  90.  
  91.  
  92. kriesi_pagination($additional_loop->max_num_pages);
  93. #end content
  94. echo '</div>';
  95.  
  96. $k_option['showSidebar'] = 'frontpage';
  97. get_sidebar();
  98.  
  99. get_footer();
  100. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement