Using custom field to display images in post
-
I’m currently using custom fields to display image thumbnails (that link to posts) on the front page of a wordpress site.
Now what I’m trying to do is use a custom field to display a large image within each single post. I’d prefer to code it into the template rather than use a plugin.
I used the solution presented here to get the thumbnail thing working, however it doesn’t seem to work for the inpost image.
I get this error:
Parse error: parse error, unexpected ‘=’ in \themes\THEME\single.php on line 15<?php get_header(); ?> <?php get_sidebar(); ?> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div id="sample-image"> <!-- THIS IS WHERE THE IMAGE SHOULD GO --> </div> <div class="post-single" id="post-single-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?> <p class="postmetadata alt"> <small> Filed under <?php the_category(', ') ?>. </small> </p> </div> </div> <div class="navigation"> <div class="alignleft"><?php previous_post_link('« %link') ?></div> <div class="alignright"><?php next_post_link('%link »') ?></div> </div> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> </div> <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Using custom field to display images in post’ is closed to new replies.