Advertisement
Guest User

loop.php file

a guest
Jan 20th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.96 KB | None | 0 0
  1. <?php if (have_posts()) : ?>
  2.  
  3. <?php while (have_posts()) : the_post(); global $graphene_settings; ?>
  4.  
  5.  
  6.  
  7. <?php /* Posts navigation for single post pages, but not for Page post */ ?>
  8.  
  9. <?php if (is_single() && !is_page()) : ?>
  10.  
  11. <div class="post-nav clearfix">
  12.  
  13. <p id="previous"><?php previous_post_link(); ?></p>
  14.  
  15. <p id="next-post"><?php next_post_link(); ?></p>
  16.  
  17. <?php do_action('graphene_post_nav'); ?>
  18.  
  19. </div>
  20.  
  21. <?php endif; ?>
  22.  
  23.  
  24.  
  25.  
  26.  
  27. <div id="post-<?php the_ID(); ?>" <?php post_class('clearfix post'); ?>>
  28.  
  29.  
  30.  
  31. <?php /* Post date is not shown if this is a Page post */ ?>
  32.  
  33. <?php if (!is_page() && ( strpos($graphene_settings['post_date_display'], 'icon_') === 0 ) && get_post_type($post) != 'page') : ?>
  34.  
  35. <div class="date">
  36.  
  37. <p class="default_date"><?php the_time('M'); ?><br /><span><?php the_time('d') ?></span>
  38.  
  39. <?php if ($graphene_settings['post_date_display'] == 'icon_plus_year') : ?>
  40.  
  41. <br /><span class="year"><?php the_time('Y'); ?></span>
  42.  
  43. <?php endif; ?>
  44.  
  45. </p>
  46.  
  47.  
  48.  
  49. <?php do_action('graphene_post_date'); ?>
  50.  
  51. </div>
  52.  
  53. <?php endif; ?>
  54.  
  55.  
  56.  
  57. <?php /* Show the post author's gravatar if enabled */
  58.  
  59. if ($graphene_settings['show_post_avatar'] && !is_page() && get_post_type($post) != 'page') {
  60.  
  61. echo get_avatar(get_the_author_meta('user_email'), 40);
  62.  
  63. } ?>
  64.  
  65.  
  66.  
  67. <?php do_action('graphene_before_post'); ?>
  68.  
  69.  
  70.  
  71. <div class="entry clearfix">
  72.  
  73.  
  74.  
  75. <?php /* Post title */ ?>
  76.  
  77. <?php if (!is_page()) : ?>
  78.  
  79. <h2 class="post-title">
  80.  
  81. " rel="bookmark" title="<?php printf(esc_attr__('Permalink Link to %s', 'graphene'), the_title_attribute('echo=0')); ?>"><?php if (get_the_title() == '') {_e('(No title)','graphene');} else {the_title();} ?>
  82.  
  83. <?php do_action('graphene_post_title'); ?>
  84.  
  85. </h2>
  86.  
  87. <?php endif; ?>
  88.  
  89.  
  90.  
  91.  
  92.  
  93. <?php /* Post meta */ ?>
  94.  
  95. <?php if (get_post_type($post) != 'page' || is_user_logged_in()) : ?>
  96.  
  97. <div class="post-meta clearfix">
  98.  
  99.  
  100.  
  101. <?php /* Post category, not shown if this is a Page post or if admin decides to hide it */ ?>
  102.  
  103. <?php if (!is_page() && ($graphene_settings['hide_post_cat'] != true)) : ?>
  104.  
  105. <ul class="meta_categories">
  106.  
  107. <li><?php the_category(",</li>\n<li>") ?></li>
  108.  
  109. </ul>
  110.  
  111. <?php endif; ?>
  112.  
  113.  
  114.  
  115. <?php /* Edit post link, if user is logged in */ ?>
  116.  
  117. <?php if (is_user_logged_in()) : ?>
  118.  
  119. <p class="edit-post">
  120.  
  121. <?php edit_post_link(__('Edit post','graphene'), ' (', ')'); ?>
  122.  
  123. </p>
  124.  
  125. <?php endif; ?>
  126.  
  127.  
  128.  
  129. <?php /* Inline post date */
  130.  
  131. if ($graphene_settings['post_date_display'] == 'text' && !is_page()){
  132.  
  133. echo '<p class="post-date-inline">';
  134.  
  135. the_time(get_option('date_format'));
  136.  
  137. echo '</p>';
  138.  
  139. }
  140.  
  141. ?>
  142.  
  143.  
  144.  
  145. <?php /* Post author, not not shown if this is a Page post or if admin decides to hide it */ ?>
  146.  
  147. <?php if ($graphene_settings['hide_post_author'] != true) : ?>
  148.  
  149. <p class="post-author">
  150.  
  151. <?php
  152.  
  153. if (!is_page() && get_post_type($post) != 'page') {
  154.  
  155. /* translators: this is for the author byline, such as 'by John Doe' */
  156.  
  157. _e('by','graphene'); echo ' '; the_author_posts_link();
  158.  
  159. }
  160.  
  161. ?>
  162.  
  163. </p>
  164.  
  165. <?php endif; ?>
  166.  
  167.  
  168.  
  169. <?php do_action('graphene_post_meta'); ?>
  170.  
  171. </div>
  172.  
  173. <?php endif; ?>
  174.  
  175.  
  176.  
  177. <?php /* Post content */ ?>
  178.  
  179. <div class="entry-content clearfix">
  180.  
  181. <?php do_action('graphene_before_post_content'); ?>
  182.  
  183.  
  184.  
  185. <?php if ((is_home() && !$graphene_settings['posts_show_excerpt']) || is_singular()) : ?>
  186.  
  187. <?php the_content('<span class="block-button">'.__('Read the rest of this entry &raquo;','graphene').'</span>'); ?>
  188.  
  189. <?php else : ?>
  190.  
  191. <?php /* The post thumbnail */
  192.  
  193. if (has_post_thumbnail(get_the_ID())) {
  194.  
  195. echo '<div class="excerpt-thumb">';
  196.  
  197. the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'));
  198.  
  199. echo '</div>';
  200.  
  201. } else {
  202.  
  203. echo graphene_get_post_image(get_the_ID(), apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
  204.  
  205. }
  206.  
  207. ?>
  208.  
  209. <?php the_excerpt(); ?>
  210.  
  211. <?php endif; ?>
  212.  
  213.  
  214.  
  215. <?php wp_link_pages(array('before' => __('<div class="link-pages"><p><strong>Pages:</strong> ','graphene'), 'after' => '</p></div>', 'next_or_number' => 'number')); ?>
  216.  
  217.  
  218.  
  219. <?php do_action('graphene_after_post_content'); ?>
  220.  
  221.  
  222.  
  223. </div>
  224.  
  225.  
  226.  
  227. <?php /* Post footer */ ?>
  228.  
  229. <div class="entry-footer clearfix">
  230.  
  231. <?php /* Display the post's tags, if there is any */ ?>
  232.  
  233. <?php if (!is_page() && get_post_type($post) != 'page' && ($graphene_settings['hide_post_tags'] != true)) : ?>
  234.  
  235. <p class="post-tags"><?php if (has_tag()) {_e('Tags:','graphene'); the_tags(' ', ', ', '');} else {_e('This post has no tag','graphene');} ?></p>
  236.  
  237. <?php endif; ?>
  238.  
  239.  
  240.  
  241. <?php
  242.  
  243. /**
  244.  
  245. * Display AddThis social sharing button if single post page, comments popup link otherwise.
  246.  
  247. * See the graphene_addthis() function in functions.php
  248.  
  249. */
  250.  
  251. ?>
  252.  
  253. <?php if (is_single() || is_page()) : ?>
  254.  
  255. <?php graphene_addthis(get_the_ID()); ?>
  256.  
  257. <?php elseif ($graphene_settings['hide_post_commentcount'] != true && comments_open()) : ?>
  258.  
  259. <p class="comment-link"><?php comments_popup_link(__('Leave comment','graphene'), __('1 comment','graphene'), __("% comments",'graphene')); ?></p>
  260.  
  261. <?php endif; ?>
  262.  
  263.  
  264.  
  265. <?php do_action('graphene_post_footer'); ?>
  266.  
  267. </div>
  268.  
  269. </div>
  270.  
  271. </div>
  272.  
  273. <?php
  274.  
  275. /**
  276.  
  277. * Display the post author's bio in single-post page if enabled
  278.  
  279. */
  280.  
  281. if (is_single() && $graphene_settings['show_post_author']) :
  282.  
  283. ?>
  284.  
  285. <h4 class="author_h4"><?php _e('About the author', 'graphene'); ?></h4>
  286.  
  287. <div class="author author-info clearfix">
  288.  
  289. <?php
  290.  
  291. if (get_the_author_meta('graphene_author_imgurl')) {
  292.  
  293. echo '<img class="avatar" src="'.get_the_author_meta('graphene_author_imgurl').'" alt="" />';
  294.  
  295. } else {
  296.  
  297. echo get_avatar(get_the_author_meta('user_email'), 100);
  298.  
  299. }
  300.  
  301. ?>
  302.  
  303. <p class="author_name"><strong><?php the_author_meta('display_name'); ?></strong></p>
  304.  
  305. <p class="author_bio"><?php the_author_meta('description'); ?></p>
  306.  
  307.  
  308.  
  309. </div>
  310.  
  311. <?php endif; ?>
  312.  
  313.  
  314.  
  315. <?php
  316.  
  317. /**
  318.  
  319. * Display Adsense advertising for single post pages
  320.  
  321. * See graphene_adsense() function in functions.php
  322.  
  323. */
  324.  
  325. ?>
  326.  
  327. <?php if (is_single() || is_page() || (is_front_page() && $graphene_settings['adsense_show_frontpage']) || is_archive() || is_search()) {graphene_adsense();} ?>
  328.  
  329.  
  330.  
  331. <?php /* List the child pages if this is a page */ ?>
  332.  
  333. <?php if (is_page()) {get_template_part('loop', 'children');} ?>
  334.  
  335.  
  336.  
  337. <?php /* Get the comments template for single post pages */ ?>
  338.  
  339. <?php if (is_single() || is_page()) {comments_template();} ?>
  340.  
  341.  
  342.  
  343. <?php endwhile; ?>
  344.  
  345.  
  346.  
  347. <?php /* Display posts navigation if this is not a single post page */ ?>
  348.  
  349. <?php if (!is_single()) : ?>
  350.  
  351. <?php /* Posts navigation. See functions.php for the function definition */ ?>
  352.  
  353. <?php graphene_posts_nav(); ?>
  354.  
  355. <?php endif; ?>
  356.  
  357.  
  358.  
  359. <?php /* If there is no post, display message and search form */ ?>
  360.  
  361. <?php else : ?>
  362.  
  363. <div class="post page">
  364.  
  365. <h2><?php _e('Not found','graphene'); ?></h2>
  366.  
  367. <div class="entry-content">
  368.  
  369. <p>
  370.  
  371. <?php
  372.  
  373. if (!is_search())
  374.  
  375. _e("Sorry, but you are looking for something that isn't here. Wanna try a search?","graphene");
  376.  
  377. else
  378.  
  379. _e("Sorry, but no results were found for that keyword. Wanna try an alternative keyword search?","graphene");
  380.  
  381. ?>
  382.  
  383.  
  384.  
  385. </p>
  386.  
  387. <?php get_search_form(); ?>
  388.  
  389. </div>
  390.  
  391. </div>
  392.  
  393.  
  394.  
  395. <?php do_action('graphene_not_found'); ?>
  396.  
  397. <?php endif; ?>
  398.  
  399.  
  400.  
  401. <?php do_action('graphene_bottom_content'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement