Advertisement
Guest User

loop-posts-formats.php file

a guest
Jan 20th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. <?php /* Posts navigation for single post pages, but not for Page post */ ?>
  2. <?php if (is_single() && !is_page()) : ?>
  3. <div class="post-nav clearfix">
  4. <p id="previous"><?php previous_post_link(); ?></p>
  5. <p id="next-post"><?php next_post_link(); ?></p>
  6. <?php do_action('graphene_post_nav'); ?>
  7. </div>
  8. <?php endif; ?>
  9.  
  10. <div id="post-<?php the_ID(); ?>" <?php post_class('clearfix post-format'); ?>>
  11. <div class="entry-header">
  12. <?php
  13. global $post_format;
  14. switch ($post_format){
  15. case 'status': $format_title = __('Status update', 'graphene'); break;
  16. case 'audio': $format_title = __('Audio', 'graphene'); break;
  17. case 'image': $format_title = __('Image', 'graphene'); break;
  18. case 'video': $format_title = __('Video', 'graphene'); break;
  19. default: $format_title = __('Post format', 'graphene');
  20. }
  21. ?>
  22. <p class="format-title"><a href="<?php the_permalink(); ?>"><?php echo $format_title; ?></a></p>
  23.  
  24. <?php /* The post title */ ?>
  25. <div class="entry-title">
  26. <?php if ($post_format == 'status') : ?>
  27. <?php /* translators: This is the PHP date formatting string for the status post format. See http://php.net/manual/en/function.date.php for more details. */ ?>
  28. <p class="entry-date updated"><?php printf('%1$s &mdash; %2$s', get_the_time(__('l F j, Y', 'graphene')), get_the_time(__('g:i A', 'graphene'))); ?></p>
  29. <?php endif; ?>
  30.  
  31. <?php if (in_array($post_format, array('status','audio', 'image', 'video'))) : ?>
  32. <p class="entry-permalink"><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></p>
  33. <?php endif; ?>
  34.  
  35. <?php /* Edit post link, if user is logged in */ ?>
  36. <?php if (is_user_logged_in()) : ?>
  37. <p class="edit-post">
  38. <?php edit_post_link(__('Edit post','graphene'), ' (', ')'); ?>
  39. </p>
  40. <?php endif; ?>
  41. </div>
  42. </div>
  43. <div class="entry-content clearfix">
  44. <div class="post-format-thumbnail">
  45. <?php if ($post_format == 'status') : /* Author's avatar, displayed only for the 'status' format */ ?>
  46. <?php echo get_avatar(get_the_author_meta('user_email'), 110); ?>
  47. <?php endif; ?>
  48.  
  49. <?php if ($post_format == 'audio') : /* Featured image, displayed only for the 'audio' format */
  50. if (has_post_thumbnail(get_the_ID())) {the_post_thumbnail(array(110,110));}
  51. endif; ?>
  52. </div>
  53.  
  54. <?php /* Modify the content_width var for video post format */
  55. if ($post_format == 'video'){
  56. global $content_width;
  57. $content_width -= 25;
  58. }
  59. ?>
  60.  
  61. <?php /* Output the post content */ ?>
  62. <?php the_content(); ?>
  63.  
  64. <?php /* Revert the content_width var for video post format */
  65. if ($post_format == 'video'){
  66. $content_width += 25;
  67. }
  68. ?>
  69.  
  70. <?php if (in_array($post_format, array('image', 'video'))) : ?>
  71. <?php /* translators: This is the PHP date formatting string for the image post format. See http://php.net/manual/en/function.date.php for more details. */ ?>
  72. <p class="entry-date updated"><?php printf( __( 'Posted on: %s', 'graphene' ), '<br /><span>' . get_the_time( __( 'F j, Y', 'graphene') ) . '</span>' ); ?></p>
  73. <?php endif; ?>
  74.  
  75. <?php if ($post_format == 'status') : /* Post author, displayed only for the 'status' format */ ?>
  76. <p class="post-author vcard">&mdash; <span class="fn nickname"><?php the_author_posts_link(); ?></span></p>
  77. <?php endif; ?>
  78. </div>
  79. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement