Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I just installed WordPress and I'm trying to set a image to every post I have.

I did this:

Custom fields ----name: paddimage-gallery --value: URL of image.

I go to my home page and it does not appear.

Example of a page were it does work: MAIMPOK THEME

share|improve this question
add comment

1 Answer 1

You are almost there you just need to call it inside your theme file say in your index.php inside the loop somewhere between

<?php while ( have_posts() ) : the_post(); ?>
 ///
 ///
<?php endwhile; // End the loop. ?>

you need to add a call for that image using get_post_meta() like this:

<?php while ( have_posts() ) : the_post(); ?>
   $img_src = get_post_meta($post->ID, 'paddimage-gallery', true);
   if (isset($img_src){
     echo '<img src=' . $img_src . '>';
   }
   ///
<?php endwhile; // End the loop. ?>

Hope this Helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.