Can’t get image loaded using custom fields
-
Hi there
I need help with my WP-theme. I’m using PRiNZ BranfordMagazine 2.6 2.6 (released 2008-12-14) by Michael Oeser and I can’t get my image loaded on my front page using custom fields.
This is my code, can anyone see anything wrong with it? I used “leadimage” as NAME and http://www.texaslandsurvey.com/wp-content/uploads/2009/12/leadimage.jpg as VALUE. Thank you in advance.<!– LEAD ARTICLE –>
<div id=”fragment-1″>
<ul id=”leadarticle”>
<?php
// Lead Story module begins
query_posts(‘showposts=1&cat=1’); //selects 1 article of the category with ID 1 ?>
<?php while (have_posts()) : the_post(); ?>
<?php
// this grabs the image filename
$values = get_post_custom_values(“leadimage”);
// this checks to see if an image file exists
if (isset($values[0])) {
?>
” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img src=”<?php
// this is where the Lead Story image gets printed
$values = get_post_custom_values(“leadimage”); echo $values[0]; ?>” alt=”leadimage” id=”leadpic” />
<?php } ?>
<h3>
<?php
// this is where the name of the Lead Story category gets printed
wp_list_categories(‘include=1&title_li=&style=none’); ?>
</h3>
” rel=”bookmark” title=”<?php __(‘Permanent Link to’,’branfordmagazine’)?> <?php the_title(); ?>” class=”title”>
<?php
// this is where the title of the Lead Story gets printed
the_title(); ?>
<?php
// this is where the excerpt of the Lead Story gets printed
the_excerpt() ; ?> <span class=”read-on”> ” rel=”bookmark” title=”<?php __(‘Permanent Link to’,’branfordmagazine’)?> <?php the_title(); ?>”>
<?php _e(‘[continue reading…]’,’branfordmagazine’); ?>
</span>
<?php endwhile; ?></div>
<!– END LEAD ARTICLE –>
The topic ‘Can’t get image loaded using custom fields’ is closed to new replies.