Image gallery image.php problems
-
Im currently working on my site trying to get my blog all ironed out before i start posting to it. this blog is hopefully to make a little money so i want to be able to put ads everywhere i can on it. so ive got my images opening up full size on a page after they are clicked and ive made it go to the next photo in the gallery once its clicked.
the url is https://www.selfshotblog.net/blog if you want to have a look.
I want the comments section and the footer to be aligned to the centre at the bottom and the comments section and the paragraph of text to be to as wide as the footer and im completely stumped on this.
The image.php that im using has been patched together from a bunch of different posts on the net and has probably got plenty of irrelevant stuff in there that does nothing.
Can anybody help me out here?
<?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> » <?php the_title(); ?></h2>
<?php
// code copied from adjacent_image_link() in wp-include/media.php
$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’) ));
foreach ( $attachments as $k => $attachment )
if ( $attachment->ID == $post->ID )
break;$next_url = isset($attachments[$k+1]) ? get_permalink($attachments[$k+1]->ID) : get_permalink($attachments[0]->ID);
?><p class=”attachment”>“><?php echo wp_get_attachment_image( $post->ID, ‘full’ ); ?></p>
<div class=”navigation”>
<div class=”alignleft”><?php previous_image_link() ?></div>
<div class=”alignright”><?php next_image_link() ?></div>
</div>
<br class=”clear” /><p class=”postmetadata alt”>
<small>
This entry was posted on <?php the_time(‘l, F jS, Y’) ?> at <?php the_time() ?>
and is filed under <?php the_category(‘, ‘) ?>.
<?php the_taxonomies(); ?>
You can follow any responses to this entry through the <?php post_comments_feed_link(‘RSS 2.0’); ?> feed.<?php if ((‘open’ == $post-> comment_status) && (‘open’ == $post->ping_status)) {
// Both Comments and Pings are open ?>
You can leave a response, or ” rel=”trackback”>trackback from your own site.<?php } elseif (!(‘open’ == $post-> comment_status) && (‘open’ == $post->ping_status)) {
// Only Pings are Open ?>
Responses are currently closed, but you can ” rel=”trackback”>trackback from your own site.<?php } elseif ((‘open’ == $post-> comment_status) && !(‘open’ == $post->ping_status)) {
// Comments are open, Pings are not ?>
You can skip to the end and leave a response. Pinging is currently not allowed.<?php } elseif (!(‘open’ == $post-> comment_status) && !(‘open’ == $post->ping_status)) {
// Neither Comments, nor Pings are open ?>
Both comments and pings are currently closed.<?php } edit_post_link(‘Edit this entry.’,”,”); ?>
</small>
</p></div>
</div>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p>Sorry, no attachments matched your criteria.</p>
<?php endif; ?>
</div>
<?php get_footer(); ?>
`
- The topic ‘Image gallery image.php problems’ is closed to new replies.