Editing Single.php to display image

  • Unknown's avatar

    Hello all,

    I’m going to be honest, I am not very familiar with PHP and need some help.

    What I want to do is to be able edit my single.php file in my theme so that I can display an image below where the posted content is, and above where the comment section is.

    I also want to have this image be a link that links back to my homepage.

    What I am asking for:

    I need to know what code to write, or if I need to make a new file to write the code in and call it in the single.php.

    I also need to know where to write the code. below is the code for my single.php file.

    Thank you

    <?php get_header(); ?>
    <div class=”art-contentLayout”>
    <div class=”art-content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php
    $prev_link = get_previous_post_link(‘« %link’);
    $next_link = get_next_post_link(‘%link »’);
    ?>
    <?php if ($prev_link || $next_link): ?>
    <div class=”art-Post”>
    <div class=”art-Post-tl”></div>
    <div class=”art-Post-tr”></div>
    <div class=”art-Post-bl”></div>
    <div class=”art-Post-br”></div>
    <div class=”art-Post-tc”></div>
    <div class=”art-Post-bc”></div>
    <div class=”art-Post-cl”></div>
    <div class=”art-Post-cr”></div>
    <div class=”art-Post-cc”></div>
    <div class=”art-Post-body”>
    <div class=”art-Post-inner art-article”>

    <div class=”art-PostContent”>

    <div class=”navigation”>
    <div class=”alignleft”><?php echo $prev_link; ?></div>
    <div class=”alignright”><?php echo $next_link; ?></div>
    </div>

    </div>
    <div class=”cleared”></div>

    </div>

    </div>
    </div>

    <?php endif; ?>
    <div class=”art-Post”>
    <div class=”art-Post-tl”></div>
    <div class=”art-Post-tr”></div>
    <div class=”art-Post-bl”></div>
    <div class=”art-Post-br”></div>
    <div class=”art-Post-tc”></div>
    <div class=”art-Post-bc”></div>
    <div class=”art-Post-cl”></div>
    <div class=”art-Post-cr”></div>
    <div class=”art-Post-cc”></div>
    <div class=”art-Post-body”>
    <div class=”art-Post-inner art-article”>
    <h2 class=”art-PostHeaderIcon-wrapper”>
    <img src=”<?php bloginfo(‘template_url’); ?>/images/PostHeaderIcon.png” width=”28″ height=”31″ alt=”” />
    <span class=”art-PostHeader”>” rel=”bookmark” title=”<?php printf(__(‘Permanent Link to %s’, ‘kubrick’), the_title_attribute(‘echo=0’)); ?>”>
    <?php the_title(); ?>
    </span>
    </h2>
    <?php ob_start(); ?>
    <?php $icons = array(); ?>
    <?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__(‘F jS, Y’, ‘kubrick’)) ?>
    <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (current_user_can(‘edit_post’, $post->ID)): ?><?php ob_start(); ?><img src=”<?php bloginfo(‘template_url’); ?>/images/PostEditIcon.png” width=”14″ height=”14″ alt=”” />
    <?php edit_post_link(__(‘Edit’, ‘kubrick’), ”); ?>
    <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
    <div class=”art-PostHeaderIcons art-metadata-icons”>
    <?php echo implode(‘ | ‘, $icons); ?>

    </div>
    <?php endif; ?>
    <?php $metadataContent = ob_get_clean(); ?>
    <?php if (trim($metadataContent) != ”): ?>
    <div class=”art-PostMetadataHeader”>
    <?php echo $metadataContent; ?>

    </div>
    <?php endif; ?>
    <div class=”art-PostContent”>
    <?php if (is_search()) the_excerpt(); else the_content(__(‘Read the rest of this entry »’, ‘kubrick’)); ?>

    </div>
    <div class=”cleared”></div>
    <?php ob_start(); ?>
    <?php $icons = array(); ?>
    <?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><?php the_tags(__(‘Tags:’, ‘kubrick’) . ‘ ‘, ‘, ‘, ‘ ‘); ?>
    <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><img src=”<?php bloginfo(‘template_url’); ?>/images/PostCommentsIcon.png” width=”11″ height=”12″ alt=”” />
    <?php comments_popup_link(__(‘No Comments »’, ‘kubrick’), __(‘1 Comment »’, ‘kubrick’), __(‘% Comments »’, ‘kubrick’), ”, __(‘Comments Closed’, ‘kubrick’) ); ?>
    <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
    <div class=”art-PostFooterIcons art-metadata-icons”>
    <?php echo implode(‘ | ‘, $icons); ?>

    </div>
    <?php endif; ?>
    <?php $metadataContent = ob_get_clean(); ?>
    <?php if (trim($metadataContent) != ”): ?>
    <div class=”art-PostMetadataFooter”>
    <?php echo $metadataContent; ?>

    </div>
    <?php endif; ?>

    </div>
    <div>

    </div>
    </div>
    </div>

    <?php comments_template(); ?>
    <?php endwhile; ?>
    <?php else: ?>
    <h2 class=”center”><?php _e(‘Sorry, no posts matched your criteria.’, ‘kubrick’); ?></h2>
    <?php endif; ?>

    </div>
    <?php include (TEMPLATEPATH . ‘/sidebar1.php’); ?>
    </div>
    <div class=”cleared”></div>

    <?php get_footer(); ?>

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    The blog you specified at wouldyoulikeafrywiththat.com does not appear to be hosted at WordPress.com.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

  • The topic ‘Editing Single.php to display image’ is closed to new replies.