wrightj999

index.php of www.wholeaf.com

Sep 28th, 2011
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. <?php
  2. get_header(); ?>
  3.  
  4. <div id="content-wrap">
  5. <div id="content">
  6.  
  7. <?php if ( $paged < 2 ) { // Do stuff specific to first page ?>
  8.  
  9. <?php if (have_posts()) : ?>
  10. <?php
  11. $sticky=get_option('sticky_posts');
  12. $args=array(
  13. 'caller_get_posts'=>1,
  14. 'post__not_in' => $sticky,
  15. 'posts_per_page'=>1,
  16. );
  17. $my_query = new WP_Query($args);
  18. while ($my_query->have_posts()) : $my_query->the_post();
  19. $do_not_duplicate = $post->ID;?>
  20. <div class="xxxpost lastlast" id="post-<?php the_ID(); ?>">
  21. <?php $key="thumbnail";
  22. if(get_post_meta($post->ID, $key, true)):
  23. $inis = get_post_meta($post->ID, $key, true);
  24. else:
  25. $inis = catch_that_image();
  26. endif;
  27.  
  28. if(!empty($inis)): ?>
  29. <div class="lastimage pik" style="background: url(<?php echo $inis; ?>) center no-repeat; width: 275px; height:200px; border: 1px solid #777;">
  30. </div>
  31.  
  32. <?php endif; ?>
  33. <div class="atas-post"><?php the_time('F jS, Y') ?> - <?php the_time() ?> <!-- &sect; <?php _e('by'); ?> <?php the_author() ?> --> &sect; in <?php the_category(', ') ?></div>
  34. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  35.  
  36.  
  37.  
  38. <div class="entry">
  39. <?php
  40. $content = get_the_content('read more');
  41. $content = apply_filters('the_content', $content);
  42. $content = preg_replace('|<img (.+?)>|i', '', $content);
  43. $content = preg_replace('|<div id="attachment_(.+?)" class="wp-caption(.+?)<\/div>|i', '', $content);
  44. echo $content; ?>
  45. </div>
  46.  
  47. <div class="postmetadata"><span class="lefter"><?php the_tags('Tags: ', ', ', ''); ?></span> <span class="righter"><?php edit_post_link('Edit', '', ' '); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></div>
  48. </div>
  49.  
  50.  
  51. <?php endwhile; ?>
  52. <br class="clear" />
  53. <?php
  54. $counter = 0; $counter2 = 0;
  55. $args=array(
  56. 'caller_get_posts'=>1,
  57. 'post__not_in' => $sticky,
  58. 'paged'=>$paged,
  59. 'posts_per_page'=>7,
  60. );
  61. query_posts($args);
  62. while (have_posts()) : the_post();
  63. if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts);
  64.  
  65. $counter++; $counter2++;
  66. ?>
  67. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  68. <div class="<?php if ($counter == 1) { echo 'leftside'; } else { echo 'rightside'; $counter = 0; } ?>">
  69. <div class="atas-post"><?php the_time('F jS, Y') ?> - <?php the_time() ?> <!-- &sect; <?php _e('by'); ?> <?php the_author() ?> -->&sect; in <?php the_category(', ') ?></div>
  70.  
  71. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  72. <?php
  73. $key="thumbnail";
  74. if(get_post_meta($post->ID, $key, true)):
  75. $inis = get_post_meta($post->ID, $key, true);
  76. else:
  77. $inis = catch_that_image();
  78. endif;
  79.  
  80. if(!empty($inis)): ?>
  81. <div class="theimage pik" style="background: url(<?php echo $inis; ?>) center top no-repeat; width: 150px; height:110px; border: 1px solid #777;"></div>
  82. <?php endif; ?>
  83.  
  84. <div class="entry">
  85. <p><?php
  86. $texter = get_the_excerpt();
  87. if(strlen($texter ) > 300) {
  88. $texter = substr($texter , 0, 300);
  89. }
  90. echo ''.$texter.'[...]';
  91. ?>
  92. </p>
  93. </div>
  94.  
  95. <div class="postmetadata"><span class="lefter"><?php the_tags('Tags: ', ', ', ''); ?></span> <span class="righter"><?php edit_post_link('Edit', '', ' '); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></div>
  96.  
  97. </div>
  98.  
  99. <br class="clear" /> </div>
  100.  
  101. <?php endwhile; ?>
  102. <br class="clear" />
  103.  
  104. <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
  105. <div class="navigation">
  106. <div class="alignleft">
  107. <?php next_posts_link('&larr; Previous Entries') ?>
  108. </div>
  109. <div class="alignright">
  110. <?php previous_posts_link('Next Entries &rarr;') ?>
  111. </div>
  112. </div>
  113. <?php } ?>
  114.  
  115.  
  116. <?php else : ?>
  117.  
  118. <h2 class="center">Not Found</h2>
  119. <p class="center">Sorry, but you are looking for something that isn't here.</p>
  120. <?php get_search_form(); ?>
  121.  
  122. <?php endif; ?>
  123. <?php } else { // Do stuff specific to non-first page ?>
  124. <?php
  125. $counter = 0; $counter2 = 0;
  126. $args=array(
  127. 'caller_get_posts'=>1,
  128. 'post__not_in' => $sticky,
  129. 'paged'=>$paged,
  130. 'posts_per_page'=>6,
  131. );
  132. query_posts($args);
  133. while (have_posts()) : the_post();
  134. $counter++; $counter2++;
  135. ?>
  136.  
  137. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  138. <div class="<?php if ($counter == 1) { echo 'leftside'; } else { echo 'rightside'; $counter = 0; } ?>">
  139. <div class="atas-post"><?php the_time('F jS, Y') ?> - <?php the_time() ?> <!-- &sect; <?php _e('by'); ?> <?php the_author() ?> -->&sect; in <?php the_category(', ') ?></div>
  140. <?php
  141. $key="thumbnail";
  142. if(get_post_meta($post->ID, $key, true)):
  143. $inis = get_post_meta($post->ID, $key, true);
  144. else:
  145. $inis = catch_that_image();
  146. endif;
  147.  
  148. if(!empty($inis)): ?>
  149. <div class="theimage pik" style="background: url(<?php echo $inis; ?>) center top no-repeat; width: 150px; height:110px; border: 1px solid #777;"></div>
  150. <?php endif; ?>
  151. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  152.  
  153. <div class="entry">
  154. <p><?php
  155. $texter = get_the_excerpt();
  156. if(strlen($texter ) > 300) {
  157. $texter = substr($texter , 0, 300);
  158. }
  159. echo ''.$texter.'[...]';
  160. ?>
  161. </p>
  162. </div>
  163.  
  164. <div class="postmetadata"><span class="lefter"><?php the_tags('Tags: ', ', ', ''); ?></span> <span class="righter"><?php edit_post_link('Edit', '', ' '); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></div>
  165. </div>
  166. </div>
  167.  
  168.  
  169. <?php endwhile; ?>
  170. <br class="clear" />
  171.  
  172. <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
  173. <div class="navigation">
  174. <div class="alignleft">
  175. <?php next_posts_link('&larr; Previous Entries') ?>
  176. </div>
  177. <div class="alignright">
  178. <?php previous_posts_link('Next Entries &rarr;') ?>
  179. </div>
  180. </div>
  181. <?php } ?>
  182.  
  183.  
  184. <?php } ?>
  185. </div>
  186. </div>
  187.  
  188. <br class="clear" />
  189.  
  190. <?php get_sidebar(); ?>
  191.  
  192. <?php get_footer(); ?>
  193.  
  194.  
Add Comment
Please, Sign In to add comment