Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <!-- Begin wrap -->
- <div id="container">
- <div id="post_content">
- <!-- Grab posts -->
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <!-- Dont' touch this code! -->
- <?php
- $parent = $post->post_parent;
- $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'ID') ) );
- foreach ( $attachments as $k => $attachment )
- if ( $attachment->ID == $post->ID )
- break;
- $next = $k+1;
- $prev = $k-1;
- $next_link = "";
- $prev_link = "";
- if ( isset($attachments[$next]) )
- {
- $next_exists = 1;
- $next_link = "<a href='" . get_attachment_link( $attachments[$next]->ID ) . "'> »</a>";
- $img_link = "<a href='" . get_attachment_link( $attachments[$next]->ID ) . "'>";
- }
- if ( isset($attachments[$prev]) )
- {
- $prev_exists = 1;
- $prev_link = "<a href='" . get_attachment_link( $attachments[$prev]->ID ) . "'> «</a>";
- if (!$next_exists)
- {
- $img_link = "<a href='" . get_attachment_link( $attachments[$prev]->ID ) . "'>";
- }
- }
- if (!$next_exists and !$prev_exists)
- {
- $img_link = "<a href='" . get_attachment_link( $attachments[$k]->ID ) . "'>";
- }
- $img_url = wp_get_attachment_url( $attachments[$k]->ID );
- if (sizeof($matches) > 1)
- {
- $fn = "/home/phasenet/public_html" . $matches[1];
- $exif_data = read_exif_data($fn);
- }
- ?>
- <!-- Next/Previous Posts -->
- <div class="mp_full">
- <div id="more_posts_full">
- <div class="mp_full_adjust">
- <div class="oe"><?php echo $prev_link ?></div>
- <div class="re"><?php echo $next_link ?></div>
- </div>
- </div>
- </div>
- <!-- Post title -->
- <h1 class="post">
- <?php echo get_the_title($post->post_parent); ?>
- </h1>
- <!-- Get the image, its caption, and description -->
- <?php echo wp_get_attachment_image( $post->ID, 'large' ); ?>
- <h2><?php if ( !empty($post->post_excerpt) ) the_excerpt(); ?></h2>
- <?php the_content(); ?>
- <?php
- $gallery_images = new WP_Query(array(
- 'post_parent' => $post->ID,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'post_status' => 'inherit',
- )
- );
- ?>
- <?php
- while ( $gallery_images->have_posts() ) : $gallery_images->the_post();
- the_title();
- the_content();
- the_permalink();
- whatever();
- endwhile;
- // always reset the post data at the end of any non-main loop
- wp_reset_postdata();
- ?>
- <?php endwhile; else: ?>
- <p>Sorry, no attachments matched your criteria.</p>
- <?php endif; ?>
- <!-- End wrap -->
- </div>
- <?php get_sidebar(); ?>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement