Advertisement
Guest User

To show the home page like the archive page in Graphene them

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