PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/blog/wp-content/themes/notepad/image.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 119 lines | 101 code | 10 blank | 8 comment | 10 complexity | 461287d17389ced2ebefe55717f9b1d4 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Notepad
  5. */
  6. get_header();
  7. ?>
  8. <div id="content_container">
  9. <div class="navigation">
  10. <?php previous_post_link( '&laquo; %link' ) ?>&nbsp;&nbsp;&#124;&nbsp;&nbsp;<?php next_post_link( '%link &raquo;' ) ?>
  11. </div><!--.navigation-->
  12. <div id="content" class="singlepage image-attachment">
  13. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  14. <div class="post" id="post-<?php the_ID(); ?>">
  15. <h2>
  16. <a href="<?php echo get_permalink( $post->post_parent ); ?>" rev="attachment">
  17. <?php echo get_the_title( $post->post_parent ); ?>
  18. </a> &raquo;
  19. <?php the_title(); ?>
  20. </h2>
  21. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  22. <?php
  23. // Get URL of next attachment in gallery OR the URL of the parent post
  24. $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' ) ) );
  25. foreach ( $attachments as $k => $attachment ) {
  26. if ( $attachment->ID == $post->ID )
  27. break;
  28. }
  29. $k++;
  30. if ( isset( $attachments[ $k ] ) )
  31. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
  32. else
  33. $next_attachment_url = get_permalink( $post->post_parent );
  34. ?>
  35. <div class="centered">
  36. <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo wp_get_attachment_image( $post->ID, array( 775, 9999 ) ); ?></a>
  37. <?php if ( !empty( $post->post_excerpt ) ) : ?>
  38. <div class="caption">
  39. <?php the_excerpt(); ?>
  40. </div>
  41. <?php endif; ?>
  42. </div>
  43. <div class="post-nav">
  44. <div class="alignleft previous">
  45. <?php previous_image_link( false, __( 'Previous image', 'notepad-theme' ) ) ?>
  46. </div>
  47. <div class="alignright next">
  48. <?php next_image_link( false, __( 'Next image', 'notepad-theme' ) ) ?>
  49. </div>
  50. <br class="clear" />
  51. </div>
  52. <?php the_content(__( '<div class="read_more">read more &raquo;</div>', 'notepad-theme' )); ?>
  53. <p class="postmetadata">
  54. <p>
  55. <small>
  56. <?php
  57. $metadata = wp_get_attachment_metadata();
  58. printf(__( 'Posted on %1$s at %2$s at <a href="%3$s" title="%4$s">%5$s &times; %6$s</a>', 'notepad-theme' ),
  59. get_the_time( 'l, F jS, Y' ),
  60. get_the_time(),
  61. wp_get_attachment_url(),
  62. esc_attr( __('Link to full-size image', 'notepad-theme') ),
  63. $metadata['width'],
  64. $metadata['height']
  65. );
  66. ?>
  67. </small>
  68. </p>
  69. <p>
  70. <small>
  71. <?php if ( comments_open() && pings_open() ) {
  72. // Both Comments and Pings are open ?>
  73. <a href="#respond">
  74. <?php _e( 'Respond','notepad-theme' ) ?>
  75. </a>&nbsp;&#124;
  76. <a href="<?php trackback_url(); ?>" rel="trackback">
  77. <?php _e( 'Trackback URL','notepad-theme' )?>
  78. </a>
  79. <?php } elseif ( !comments_open() && pings_open() ) {
  80. // Only Pings are Open ?>
  81. <?php _e( 'You can', 'notepad-theme' )?>
  82. <a href="<?php trackback_url(); ?> " rel="trackback">
  83. <?php _e( 'trackback','notepad-theme' )?>
  84. </a>
  85. <?php _e( ' from your own site.','notepad-theme' )?>
  86. <?php } elseif ( comments_open() && !pings_open() ) {
  87. // Comments are open, Pings are not ?>
  88. <?php _e( 'You can skip to the end and leave a ', 'notepad-theme' )?>
  89. <a href="#respond">
  90. <?php _e( 'response.','notepad-theme' )?>
  91. </a>
  92. <?php
  93. }
  94. echo "&nbsp;| ";
  95. edit_post_link(__( ' Edit this entry', 'notepad-theme' ),'','.');
  96. ?>
  97. </small>
  98. </p>
  99. </div><!--.entry-->
  100. <?php comments_template(); ?>
  101. </div><!--.post-->
  102. <?php endwhile; else: ?>
  103. <p>
  104. <?php _e( 'Sorry, no attachments matched your criteria.', 'uti_theme' )?>
  105. </p>
  106. <?php endif; ?>
  107. </div><!--#content-->
  108. </div><!--#content_container-->
  109. <?php get_footer(); ?>