Advertisement
Guest User

loop.php

a guest
Jul 9th, 2011
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.71 KB | None | 0 0
  1. <?php if (have_posts()) : ?>
  2. <?php while (have_posts()) : the_post(); global $graphene_settings; ?>
  3.  
  4. <?php /* Posts navigation for single post pages, but not for Page post */ ?>
  5. <?php if (is_single() && !is_page()) : ?>
  6. <div class="post-nav clearfix">
  7. <p id="previous"><?php previous_post_link(); ?></p>
  8. <p id="next-post"><?php next_post_link(); ?></p>
  9. <?php do_action('graphene_post_nav'); ?>
  10. </div>
  11. <?php endif; ?>
  12.  
  13.  
  14. <div id="post-<?php the_ID(); ?>" <?php post_class('clearfix post'); ?>>
  15.  
  16. <?php /* Post date is not shown if this is a Page post */ ?>
  17. <?php if (!is_page() && ( strpos($graphene_settings['post_date_display'], 'icon_') === 0 ) && get_post_type($post) != 'page') : ?>
  18. <div class="date updated">
  19. <p class="default_date"><?php the_time('M'); ?><br /><span><?php the_time('d') ?></span>
  20. <?php if ($graphene_settings['post_date_display'] == 'icon_plus_year') : ?>
  21. <br /><span class="year"><?php the_time('Y'); ?></span>
  22. <?php endif; ?>
  23. </p>
  24.  
  25. <?php do_action('graphene_post_date'); ?>
  26.  
  27. </div>
  28. <?php endif; ?>
  29.  
  30. <?php /* Show the post author's gravatar if enabled */
  31. if ($graphene_settings['show_post_avatar'] && !is_page() && get_post_type($post) != 'page') {
  32. echo get_avatar(get_the_author_meta('user_email'), 40);
  33. } ?>
  34.  
  35. <?php do_action('graphene_before_post'); ?>
  36.  
  37. <div class="entry clearfix">
  38.  
  39. <?php /* Post title */
  40. $tag = (is_singular() && !is_front_page()) ? 'h1' : 'h2';
  41. echo '<'.$tag.' class="post-title entry-title">';
  42. ?>
  43. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(esc_attr__('Permalink to %s', 'graphene'), the_title_attribute('echo=0')); ?>"><?php if (get_the_title() == '') {_e('(No title)','graphene');} else {the_title();} ?></a>
  44. <?php do_action('graphene_post_title'); ?>
  45. <?php echo '</'.$tag.'>'; ?>
  46.  
  47. <?php /* Post meta */ ?>
  48. <?php if (get_post_type($post) != 'page' || is_user_logged_in() || (is_singular() && $graphene_settings['print_css'] && $graphene_settings['print_button'])) : ?>
  49. <div class="post-meta clearfix">
  50.  
  51. <?php /* Post category, not shown if this is a Page post or if admin decides to hide it */ ?>
  52. <?php if (!is_page() && ($graphene_settings['hide_post_cat'] != true)) : ?>
  53. <span class="printonly"><?php _e('Categories:', 'graphene'); ?> </span>
  54. <ul class="meta_categories">
  55. <li><?php the_category(",</li>\n<li>") ?></li>
  56. </ul>
  57. <?php endif; ?>
  58.  
  59. <?php
  60. /* Add a print button only for single pages/posts
  61. * and if the theme option is enabled.
  62. */
  63. if (is_singular() && $graphene_settings['print_css'] && $graphene_settings['print_button']) : ?>
  64. <p class="print"><a href="javascript:print();" title="<?php esc_attr_e('Print this page', 'graphene'); ?>"><span><?php _e('Print this page', 'graphene'); ?></span></a></p>
  65. <?php endif; ?>
  66.  
  67. <?php /* Add an email post icon if the WP-Email plugin is installed and activated */
  68. if(function_exists('wp_email') && is_singular()) {echo '<p class="email">'; email_link(); echo '</p>';}
  69. ?>
  70.  
  71. <?php /* Edit post link, if user is logged in */ ?>
  72. <?php if (is_user_logged_in()) : ?>
  73. <p class="edit-post">
  74. <?php edit_post_link(__('Edit post','graphene'), ' (', ')'); ?>
  75. </p>
  76. <?php endif; ?>
  77.  
  78. <?php /* Inline post date */
  79. if ($graphene_settings['post_date_display'] == 'text' && !is_page()){
  80. echo '<p class="post-date-inline updated">';
  81. the_time(get_option('date_format'));
  82. echo '</p>';
  83. }
  84. ?>
  85.  
  86. <?php /* Post author, not not shown if this is a Page post or if admin decides to hide it */ ?>
  87. <?php if ($graphene_settings['hide_post_author'] != true) : ?>
  88. <p class="post-author vcard">
  89. <?php
  90. if (!is_page() && get_post_type($post) != 'page') {
  91. /* translators: this is for the author byline, such as 'by John Doe' */
  92. _e('by','graphene'); echo ' <span class="fn nickname">'; the_author_posts_link(); echo '</span>';
  93. }
  94. ?>
  95. </p>
  96. <?php endif; ?>
  97.  
  98. <?php /* For printing: the date of the post */
  99. if ($graphene_settings['print_css'] && !is_page() && $graphene_settings['post_date_display'] != 'hidden') {
  100. echo graphene_print_only_text(get_the_time(get_option('date_format')));
  101. }
  102. ?>
  103.  
  104. <?php do_action('graphene_post_meta'); ?>
  105. </div>
  106. <?php endif; ?>
  107.  
  108. <?php /* Post content */ ?>
  109. <div class="entry-content clearfix">
  110. <?php do_action('graphene_before_post_content'); ?>
  111.  
  112. <?php if ((is_home() && !$graphene_settings['posts_show_excerpt']) || is_singular() || (!is_singular() && !is_home() && $graphene_settings['archive_full_content'])) : ?>
  113. <?php the_content('<span class="block-button">'.__('Read the rest of this entry &raquo;','graphene').'</span>'); ?>
  114. <?php else : ?>
  115. <?php /* The post thumbnail */
  116. if (has_post_thumbnail(get_the_ID())) { ?>
  117. <div class="excerpt-thumb">
  118. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(esc_attr__('Permalink to %s', 'graphene'), the_title_attribute('echo=0')); ?>">
  119. <?php the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail')); ?>
  120. </a>
  121. </div>
  122. <?php
  123. } else {
  124. echo graphene_get_post_image(get_the_ID(), apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
  125. }
  126. ?>
  127. <?php the_excerpt(); ?>
  128. <?php endif; ?>
  129.  
  130. <?php wp_link_pages(array('before' => __('<div class="link-pages"><p><strong>Pages:</strong> ','graphene'), 'after' => '</p></div>', 'next_or_number' => 'number')); ?>
  131.  
  132. <?php do_action('graphene_after_post_content'); ?>
  133.  
  134. </div>
  135.  
  136. <?php /* Post footer */ ?>
  137. <div class="entry-footer clearfix">
  138. <?php /* Display the post's tags, if there is any */ ?>
  139. <?php if (!is_page() && get_post_type($post) != 'page' && ($graphene_settings['hide_post_tags'] != true)) : ?>
  140. <p class="post-tags"><?php if (has_tag()) {_e('Tags:','graphene'); the_tags(' ', ', ', '');} else {_e('This post has no tag','graphene');} ?></p>
  141. <?php endif; ?>
  142.  
  143. <?php
  144. /**
  145. * Display AddThis social sharing button if single post page, comments popup link otherwise.
  146. * See the graphene_addthis() function in functions.php
  147. */
  148. ?>
  149. <?php if (is_single() || is_page()) : ?>
  150. <?php graphene_addthis(get_the_ID()); ?>
  151. <?php elseif ($graphene_settings['hide_post_commentcount'] != true && comments_open() && graphene_should_show_comments() ) : ?>
  152. <p class="comment-link"><?php comments_popup_link(__('Leave comment','graphene'), __('1 comment','graphene'), __("% comments",'graphene')); ?></p>
  153. <?php endif; ?>
  154.  
  155. <?php do_action('graphene_post_footer'); ?>
  156. </div>
  157. </div>
  158. </div>
  159. <?php
  160. /**
  161. * Display the post author's bio in single-post page if enabled
  162. */
  163. if (is_single() && $graphene_settings['show_post_author']) :
  164. ?>
  165. <h4 class="author_h4"><?php _e('About the author', 'graphene'); ?></h4>
  166. <div class="author author-info clearfix">
  167. <?php
  168. if (get_the_author_meta('graphene_author_imgurl')) {
  169. echo '<img class="avatar" src="'.get_the_author_meta('graphene_author_imgurl').'" alt="" />';
  170. } else {
  171. echo get_avatar(get_the_author_meta('user_email'), 100);
  172. }
  173. ?>
  174. <p class="author_name"><strong><?php the_author_meta('display_name'); ?></strong></p>
  175. <p class="author_bio"><?php the_author_meta('description'); ?></p>
  176.  
  177. </div>
  178. <?php endif; ?>
  179.  
  180. <?php /* For printing: the permalink */
  181. if ($graphene_settings['print_css']) {
  182. echo graphene_print_only_text('<span class="printonly url"><strong>'.__('Permanent link to this article:', 'graphene').' </strong><span>'. get_permalink().'</span></span>');
  183. }
  184. ?>
  185.  
  186. <?php
  187. /**
  188. * Display Adsense advertising for single post pages
  189. * See graphene_adsense() function in functions.php
  190. */
  191. ?>
  192. <?php if (!is_front_page() || (is_front_page() && $graphene_settings['adsense_show_frontpage'])) {graphene_adsense();} ?>
  193.  
  194. <?php /* List the child pages if this is a page */ ?>
  195. <?php if (is_page()) {get_template_part('loop', 'children');} ?>
  196.  
  197. <?php /* Get the comments template for single post pages */ ?>
  198. <?php if (is_single() || is_page()) {comments_template();} ?>
  199.  
  200. <?php endwhile; ?>
  201.  
  202. <?php /* Display posts navigation if this is not a single post page */ ?>
  203. <?php if (!is_single()) : ?>
  204. <?php /* Posts navigation. See functions.php for the function definition */ ?>
  205. <?php graphene_posts_nav(); ?>
  206. <?php endif; ?>
  207.  
  208. <?php /* If there is no post, display message and search form */ ?>
  209. <?php else : ?>
  210. <div class="post page">
  211. <h2><?php _e('Not found','graphene'); ?></h2>
  212. <div class="entry-content">
  213. <p>
  214. <?php
  215. if (!is_search())
  216. _e("Sorry, but you are looking for something that isn't here. Wanna try a search?","graphene");
  217. else
  218. _e("Sorry, but no results were found for that keyword. Wanna try an alternative keyword search?","graphene");
  219. ?>
  220.  
  221. </p>
  222. <?php get_search_form(); ?>
  223. </div>
  224. </div>
  225.  
  226. <?php do_action('graphene_not_found'); ?>
  227. <?php endif; ?>
  228.  
  229. <?php do_action('graphene_bottom_content'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement