Advertisement
Guest User

Untitled

a guest
Jan 17th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.90 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: PageOfPosts2
  4. */
  5. /*
  6. specific for Graphene theme
  7. */
  8. global $graphene_settings;
  9. get_header(); ?>
  10.  
  11. <?php $category = get_post_meta($posts[0]->ID, 'category', true);
  12. $cat = array();
  13. if( $category ) { $cat = array(get_cat_ID($category)); }
  14.  
  15. $showposts = 8; // -1 shows all posts
  16. $do_not_show_stickies = 1; // 0 to show stickies
  17. $args=array(
  18. 'category__in' => $cat,
  19. 'showposts' => $showposts,
  20. 'caller_get_posts' => $do_not_show_stickies
  21. );
  22. $my_query = new WP_Query($args);
  23.  
  24. ?>
  25.  
  26. <?php if( $my_query->have_posts() ) : ?>
  27.  
  28. <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  29.  
  30. <?php
  31. //necessary to show the tags
  32. global $wp_query;
  33. $wp_query->in_the_loop = true;
  34. ?>
  35.  
  36. <?php global $graphene_settings; ?>
  37.  
  38. <div id="post-<?php the_ID(); ?>" <?php post_class('clearfix post'); ?>>
  39.  
  40. <?php /* Post date is not shown if this is a Page post */ ?>
  41.  
  42. <div class="date">
  43. <p class="default_date"><?php the_time('M'); ?><br /><span><?php the_time('d') ?></span>
  44. <?php if ($graphene_settings['post_date_display'] == 'icon_plus_year') : ?>
  45. <br /><span class="year"><?php the_time('Y'); ?></span>
  46. <?php endif; ?>
  47. </p>
  48.  
  49. <?php do_action('graphene_post_date'); ?>
  50. </div>
  51.  
  52. <div class="entry clearfix">
  53.  
  54. <?php /* Post title */ ?>
  55. <h2 class="post-title">
  56. <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>
  57. <?php do_action('graphene_post_title'); ?>
  58. </h2>
  59.  
  60. <?php /* Post meta */ ?>
  61.  
  62. <div class="post-meta clearfix">
  63.  
  64. <ul class="meta_categories">
  65. <li><?php the_category(",</li>\n<li>") ?></li>
  66. </ul>
  67.  
  68. <?php /* Edit post link, if user is logged in */ ?>
  69. <?php if (is_user_logged_in()) : ?>
  70. <p class="edit-post">
  71. <?php edit_post_link(__('Edit post','graphene'), ' (', ')'); ?>
  72. </p>
  73. <?php endif; ?>
  74.  
  75. <?php /* Inline post date */
  76. if ($graphene_settings['post_date_display'] == 'text' && !is_page()){
  77. echo '<p class="post-date-inline">';
  78. the_time(get_option('date_format'));
  79. echo '</p>';
  80. }
  81. ?>
  82.  
  83. <?php /* Post author, not not shown if this is a Page post or if admin decides to hide it */ ?>
  84. <?php if ($graphene_settings['hide_post_author'] != true) : ?>
  85. <p class="post-author">
  86. <?php _e('by','graphene'); echo ' '; the_author_posts_link(); ?>
  87. </p>
  88. <?php endif; ?>
  89.  
  90. <?php do_action('graphene_post_meta'); ?>
  91. </div>
  92.  
  93. <?php /* Post content */ ?>
  94. <div class="entry-content clearfix">
  95. <?php do_action('graphene_before_post_content'); ?>
  96.  
  97. <?php the_content('<span class="block-button">'.__('Read the rest of this entry &raquo;','graphene').'</span>'); ?>
  98.  
  99. <?php wp_link_pages(array('before' => __('<div class="link-pages"><p><strong>Pages:</strong> ','graphene'), 'after' => '</p></div>', 'next_or_number' => 'number')); ?>
  100.  
  101. <?php do_action('graphene_after_post_content'); ?>
  102.  
  103. </div>
  104.  
  105. <?php /* Post footer */ ?>
  106. <div class="entry-footer clearfix">
  107. <?php /* Display the post's tags, if there is any */ ?>
  108. <?php if ( ($graphene_settings['hide_post_tags'] != true)) : ?>
  109. <p class="post-tags"><?php if (has_tag()) {_e('Tags:','graphene'); the_tags(' ', ', ', '');} else {_e('This post has no tag','graphene');} ?></p>
  110. <?php endif; ?>
  111.  
  112. <?php
  113. /**
  114. * Display AddThis social sharing button if single post page, comments popup link otherwise.
  115. * See the graphene_addthis() function in functions.php
  116. */
  117. ?>
  118. <?php if (is_single() || is_page()) : ?>
  119. <?php graphene_addthis(get_the_ID()); ?>
  120. <?php elseif ($graphene_settings['hide_post_commentcount'] != true && comments_open()) : ?>
  121. <p class="comment-link"><?php comments_popup_link(__('Leave comment','graphene'), __('1 comment','graphene'), __("% comments",'graphene')); ?></p>
  122. <?php endif; ?>
  123.  
  124. <?php do_action('graphene_post_footer'); ?>
  125. </div>
  126. </div>
  127. </div>
  128.  
  129. <?php
  130. /**
  131. * Display Adsense advertising for single post pages
  132. * See graphene_adsense() function in functions.php
  133. */
  134. ?>
  135. <?php if (is_single() || is_page() || (is_front_page() && $graphene_settings['adsense_show_frontpage']) || is_archive() || is_search()) {graphene_adsense();} ?>
  136.  
  137. <?php endwhile; ?>
  138.  
  139. <?php /* Display posts navigation if this is not a single post page */ ?>
  140. <?php if (!is_single()) : ?>
  141. <?php /* Posts navigation. See functions.php for the function definition */ ?>
  142. <?php graphene_posts_nav(); ?>
  143. <?php endif; ?>
  144.  
  145. <?php /* If there is no post, display message and search form */ ?>
  146. <?php else : ?>
  147. <div class="post page">
  148. <h2><?php _e('Not found','graphene'); ?></h2>
  149. <div class="entry-content">
  150. <p>
  151. <?php
  152. if (!is_search())
  153. _e("Sorry, but you are looking for something that isn't here. Wanna try a search?","graphene");
  154. else
  155. _e("Sorry, but no results were found for that keyword. Wanna try an alternative keyword search?","graphene");
  156. ?>
  157.  
  158. </p>
  159. <?php get_search_form(); ?>
  160. </div>
  161. </div>
  162.  
  163. <?php do_action('graphene_not_found'); ?>
  164. <?php endif; ?>
  165.  
  166. <?php do_action('graphene_bottom_content'); ?>
  167.  
  168. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement