Advertisement
Guest User

Untitled

a guest
Mar 6th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.02 KB | None | 0 0
  1. <?php
  2.  
  3.     global $graphene_settings;
  4.  
  5.     $post_type = get_post_type_object( get_post_type() );
  6.  
  7. ?>
  8.  
  9. <?php
  10.  
  11. /**
  12.  
  13.  * Check if the post has a post format. Load a post-format specific loop file,
  14.  
  15.  * if it has. Continue with standard loop otherwise.
  16.  
  17. */
  18.  
  19. if ( function_exists( 'get_post_format' ) && $post_type->name != 'page' ) {
  20.  
  21.     global $post_format;
  22.  
  23.     $post_format = get_post_format();
  24.  
  25.    
  26.  
  27.     // Get the post formats supported by the theme
  28.  
  29.     $supported_formats = get_theme_support( 'post-formats' );
  30.  
  31.     if ( is_array( $supported_formats ) ) $supported_formats = $supported_formats[0];
  32.  
  33.    
  34.  
  35.     if ( in_array( $post_format, $supported_formats ) ) {
  36.  
  37.        
  38.  
  39.         // Get the post format loop file
  40.  
  41.         get_template_part( 'loop-post-formats', $post_format );
  42.  
  43.        
  44.  
  45.         // Stop this default posts loop
  46.  
  47.         return;
  48.  
  49.     }
  50.  
  51. }
  52.  
  53. ?>
  54.  
  55.  
  56.  
  57. <?php if ( $post_type->name == 'page' && $graphene_settings['hide_parent_content_if_empty'] && $post->post_content == '' ) : ?>
  58.  
  59. <h1 class="page-title">
  60.  
  61.     <?php if ( get_the_title() == '' ) { _e( '(No title)', 'graphene' ); } else { the_title(); } ?>
  62.  
  63. </h1>
  64.  
  65. <?php else : ?>                
  66.  
  67. <div id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix post' ); ?>>
  68.  
  69.    
  70.  
  71.     <?php do_action( 'graphene_before_post' ); ?>
  72.  
  73.    
  74.  
  75.     <div class="entry clearfix">
  76.  
  77.    
  78.  
  79.         <?php /* Post date is not shown if this is a Page post */ ?>
  80.  
  81.         <?php if ( ( strpos( $graphene_settings['post_date_display'], 'icon_' ) === 0 ) && graphene_should_show_date() ) : ?>
  82.  
  83.             <?php graphene_post_date(); ?>
  84.  
  85.         <?php endif; ?>
  86.  
  87.        
  88.  
  89.         <?php /* Show the post author's gravatar if enabled */
  90.  
  91.         if ( $graphene_settings['show_post_avatar'] ) {
  92.  
  93.             echo '<div class="post-avatar-wrap gutter-left">' . get_avatar( get_the_author_meta( 'user_email' ), 45 ) . '</div>';
  94.  
  95.         }
  96.  
  97.         ?>
  98.  
  99.        
  100.  
  101.         <?php
  102.  
  103.         /* Add a print button only for single pages/posts
  104.  
  105.          * and if enabled in the theme option.
  106.  
  107.          */
  108.  
  109.         if ( $graphene_settings['print_button'] && is_singular() ) : ?>
  110.  
  111.             <?php graphene_print_button(); ?>
  112.  
  113.         <?php endif; ?>
  114.  
  115.        
  116.  
  117.         <?php /* Add an email post icon if the WP-Email plugin is installed and activated */
  118.  
  119.             if( function_exists( 'wp_email' ) && is_singular() ) { echo '<p class="email">'; email_link(); echo '</p>'; }
  120.  
  121.         ?>
  122.  
  123.        
  124.  
  125.         <?php /* Post title */ ?>
  126.  
  127.         <h2 class="post-title entry-title">
  128.  
  129.             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'graphene' ), the_title_attribute( 'echo=0' ) ); ?>">
  130.  
  131.                 <?php if ( get_the_title() == '' ) { _e( '(No title)', 'graphene' ); } else { the_title(); } ?>
  132.  
  133.             </a>
  134.  
  135.             <?php do_action( 'graphene_post_title' ); ?>
  136.  
  137.         </h2>
  138.  
  139.        
  140.  
  141.        
  142.  
  143.         <?php /* Post meta */ ?>
  144.  
  145.         <?php if ( $post_type->name != 'page' || is_user_logged_in() ) : ?>
  146.  
  147.         <div class="post-meta clearfix">
  148.  
  149.            
  150.  
  151.             <?php /* Post category, not shown if admin decides to hide it */ ?>
  152.  
  153.             <?php if ( ( $graphene_settings['hide_post_cat'] != true ) ) : ?>
  154.  
  155.             <span class="printonly"><?php _e( 'Categories:', 'graphene' ); ?> </span>
  156.  
  157.             <p class="meta_categories"><?php the_category( ", " ); ?></p>
  158.  
  159.             <?php endif; ?>
  160.  
  161.            
  162.  
  163.             <?php /* Edit post link, if user is logged in */ ?>
  164.  
  165.             <?php if ( is_user_logged_in() ) : ?>
  166.  
  167.             <p class="edit-post">
  168.  
  169.                 <?php edit_post_link( sprintf( __( 'Edit %s', 'graphene' ), $post_type->labels->singular_name ), ' (', ')' ); ?>
  170.  
  171.             </p>
  172.  
  173.             <?php endif; ?>
  174.  
  175.            
  176.  
  177.             <?php /* Inline post date */ ?>
  178.  
  179.             <?php if ( $graphene_settings['post_date_display'] == 'text' && graphene_should_show_date() ) : ?>
  180.  
  181.             <p class="post-date-inline updated">
  182.  
  183.                 <abbr class="published" title="<?php the_date( 'c' ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr>
  184.  
  185.             </p>
  186.  
  187.             <?php endif; ?>
  188.  
  189.            
  190.  
  191.             <?php /* Post author, not shown if this is a Page post or if admin decides to hide it */ ?>
  192.  
  193.             <?php if ( $post_type->name != 'page' && $graphene_settings['hide_post_author'] != true ) : ?>
  194.  
  195.             <p class="post-author author vcard">
  196.  
  197.                 <?php
  198.  
  199.                 /* translators: this is for the author byline, such as 'by John Doe' */
  200.  
  201.                 $author_url = '<a href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" class="url">' . get_the_author_meta( 'display_name' ) . '</a>';
  202.  
  203.                 printf( __( 'by %s', 'graphene' ), '<span class="fn nickname">' . $author_url . '</span>' );
  204.  
  205.                 ?>
  206.  
  207.             </p>
  208.  
  209.             <?php endif; ?>
  210.  
  211.                                
  212.  
  213.             <?php /* For printing: the date of the post */
  214.  
  215.                 if ( $graphene_settings['print_css'] && graphene_should_show_date() ) {
  216.  
  217.                      echo graphene_print_only_text( get_the_time( get_option( 'date_format' ) ) );  
  218.  
  219.                 }
  220.  
  221.             ?>
  222.  
  223.            
  224.  
  225.             <?php do_action( 'graphene_post_meta' ); ?>
  226.  
  227.         </div>
  228.  
  229.         <?php endif; ?>
  230.  
  231.        
  232.  
  233.         <?php /* Post content */ ?>
  234.  
  235.         <div class="entry-content clearfix">
  236.  
  237.             <?php do_action( 'graphene_before_post_content' ); ?>
  238.  
  239.            
  240.  
  241.             <?php if ( ( is_home() && !$graphene_settings['posts_show_excerpt'] ) || is_singular() || ( ! is_singular() && ! is_home() && $graphene_settings['archive_full_content'] ) ) : ?>
  242.  
  243.                
  244.  
  245.                 <?php /* Social sharing buttons at top of post */ ?>
  246.  
  247.                 <?php if ( stripos( $graphene_settings['addthis_location'], 'top' ) !== false) { graphene_addthis( get_the_ID() ); } ?>
  248.  
  249.                
  250.  
  251.                 <?php /* The full content */ ?>
  252.  
  253.                 <?php the_content( '<span class="block-button">' . __( 'Read the rest of this entry &raquo;', 'graphene' ) . '</span>' ); ?>
  254.  
  255.  
  256.  
  257.             <?php else : ?>
  258.  
  259.  
  260.  
  261.                 <?php /* The post thumbnail */
  262.  
  263.                 if ( has_post_thumbnail( get_the_ID() ) ) { ?>
  264.  
  265.                     <div class="excerpt-thumb">
  266.  
  267.                     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'graphene' ), the_title_attribute( 'echo=0' ) ); ?>">
  268.  
  269.                         <?php the_post_thumbnail( apply_filters( 'graphene_excerpt_thumbnail_size', 'thumbnail' ) ); ?>
  270.  
  271.                     </a>
  272.  
  273.                     </div>
  274.  
  275.                     <?php
  276.  
  277.                 } else {
  278.  
  279.                     echo graphene_get_post_image( get_the_ID(), apply_filters( 'graphene_excerpt_thumbnail_size', 'thumbnail' ), 'excerpt' );  
  280.  
  281.                 }
  282.  
  283.                 ?>
  284.  
  285.                 <?php /* The excerpt */ ?>
  286.  
  287.                 <?php the_excerpt(); ?>
  288.  
  289.                
  290.  
  291.             <?php endif; ?>
  292.  
  293.            
  294.  
  295.             <?php wp_link_pages( array( 'before' => '<div class="link-pages"><p><strong>' . __( 'Pages:','graphene' ) . '</strong> ', 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
  296.  
  297.            
  298.  
  299.             <?php do_action( 'graphene_after_post_content' ); ?>
  300.  
  301.            
  302.  
  303.         </div>
  304.  
  305.        
  306.  
  307.         <?php /* Post footer */ ?>
  308.  
  309.         <div class="entry-footer clearfix">
  310.  
  311.             <?php /* Display the post's tags, if there is any */ ?>
  312.  
  313.             <?php if ( $post_type->name != 'page' && ( $graphene_settings['hide_post_tags'] != true) ) : ?>
  314.  
  315.             <p class="post-tags"><?php if ( has_tag() ) { _e( 'Tags:', 'graphene' ); the_tags( ' ', ', ', '' ); } else { _e( 'This post has no tag','graphene' ); } ?></p>
  316.  
  317.             <?php endif; ?>
  318.  
  319.            
  320.  
  321.             <?php /* Display comments popup link. */ ?>
  322.  
  323.             <?php if ( graphene_should_show_comments() ) : ?>
  324.  
  325.             <p class="comment-link">
  326.  
  327.                 <?php
  328.  
  329.                 $comments_num = get_comments_number();
  330.  
  331.                 comments_popup_link( __( 'Leave comment', 'graphene' ), __( '1 comment', 'graphene' ), sprintf( _n( '1 comment', "%d comments", $comments_num, 'graphene' ), $comments_num ), 'comments-link', __( "Comments off", 'graphene' ) );
  332.  
  333.                 ?>
  334.  
  335.             </p>
  336.  
  337.             <?php endif; ?>
  338.  
  339.            
  340.  
  341.             <?php do_action( 'graphene_post_footer' ); ?>
  342.  
  343.         </div>
  344.  
  345.     </div>
  346.  
  347. </div>
  348.  
  349. <?php endif; ?>
  350.  
  351.  
  352.  
  353.  <?php /* For printing: the permalink */
  354.  
  355.     if ( $graphene_settings['print_css']) {
  356.  
  357.         echo graphene_print_only_text( '<span class="printonly url"><strong>' .__( 'Permanent link to this article:', 'graphene' ). ' </strong><span>' . get_permalink(). '</span></span>' );
  358.  
  359.     }
  360.  
  361. ?>
  362.  
  363.  
  364.  
  365. <?php /* Display Adsense advertising */ ?>
  366.  
  367. <?php if ( ! is_front_page() || ( is_front_page() && $graphene_settings['adsense_show_frontpage'] ) ) { graphene_adsense(); } ?>
  368.  
  369.  
  370.  
  371. <?php do_action( 'graphene_loop_footer' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement