Advertisement
Guest User

content-attachment.php

a guest
Mar 1st, 2013
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. <?php include (get_template_directory() . '/buddypress/buddypress-globals.php'); ?>
  2. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  3. <?php if ( ! empty( $post->post_parent ) ) : ?>
  4. <?php if($bp_existed == 'true') : ?>
  5. <?php do_action( 'bp_before_blog_post' ) ?>
  6. <?php endif; ?>
  7. <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'framemarket' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
  8. printf( __( '<span class="meta-nav">&larr;</span> %s', 'framemarket'), get_the_title( $post->post_parent ) );
  9. ?></a></p>
  10. <?php endif; ?>
  11. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  12. <h2 class="post-title"><?php the_title(); ?></h2>
  13. <div class="post-meta">
  14. <?php
  15. printf( __( '<span class="%1$s">By</span> %2$s', 'framemarket' ),
  16. 'meta-prep meta-prep-author',
  17. sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  18. get_author_posts_url( get_the_author_meta( 'ID' ) ),
  19. sprintf( esc_attr__( 'View all posts by %s', 'framemarket'), get_the_author() ),
  20. get_the_author()
  21. )
  22. );
  23. ?>
  24. <span class="meta-sep">|</span>
  25. <?php
  26. printf( __( '<span class="%1$s">Published</span> %2$s', 'framemarket'),
  27. 'meta-prep meta-prep-entry-date',
  28. sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>',
  29. esc_attr( get_the_time() ),
  30. get_the_date()
  31. )
  32. );
  33. if ( wp_attachment_is_image() ) {
  34. echo ' <span class="meta-sep">|</span> ';
  35. $metadata = wp_get_attachment_metadata();
  36. printf( __( 'Full size is %s pixels', 'framemarket'),
  37. sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
  38. wp_get_attachment_url(),
  39. esc_attr( __( 'Link to full-size image', 'framemarket' ) ),
  40. $metadata['width'],
  41. $metadata['height']
  42. )
  43. );
  44. }
  45. ?>
  46. <?php edit_post_link( __( 'Edit', 'framemarket'), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  47. </div>
  48.  
  49. <div class="post-content">
  50. <div class="entry-attachment">
  51. <?php if ( wp_attachment_is_image() ) :
  52. $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
  53. foreach ( $attachments as $k => $attachment ) {
  54. if ( $attachment->ID == $post->ID )
  55. break;
  56. }
  57. $k++;
  58. if ( count( $attachments ) > 1 ) {
  59. if ( isset( $attachments[ $k ] ) )
  60. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
  61. else
  62. $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
  63. } else {
  64. $next_attachment_url = wp_get_attachment_url();
  65. }
  66. ?>
  67. <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
  68. $attachment_width = apply_filters( 'framemarket_attachment_size', 900 );
  69. $attachment_height = apply_filters( 'framemarket_attachment_height', 900 );
  70. echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) );
  71. ?></a></p>
  72.  
  73. <div id="navigation-bottom" class="navigation">
  74. <?php wp_pagenavi(); ?>
  75. </div>
  76. <?php else : ?>
  77. <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
  78. <?php endif; ?>
  79. </div>
  80. <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
  81.  
  82. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'framemarket' ) ); ?>
  83. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'framemarket' ), 'after' => '</div>' ) ); ?>
  84.  
  85. </div>
  86.  
  87. <div class="post-info">
  88. <?php framemarket_postedin(); ?>
  89. <?php edit_post_link( __( 'Edit', 'framemarket'), ' <span class="edit-link">', '</span>' ); ?>
  90. </div>
  91. <?php if($bp_existed == 'true') : ?>
  92. <?php do_action( 'bp_after_blog_post' ) ?>
  93. <?php endif; ?>
  94. </div>
  95. <?php comments_template(); ?>
  96. <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement