Title: echo multiple custom fields
Last modified: August 20, 2016

---

# echo multiple custom fields

 *  [markoburns](https://wordpress.org/support/users/markoburns/)
 * (@markoburns)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/echo-multiple-custom-fields/)
 * Maybe this is simple but I can’t find the answer – I’ve got multiple custom fields
   called photo1, photo2, photo3 etc., and I’m trying to print them all in single.
   php but the code I am using only prints 1 – can anyone help? (php newbie) I thought
   $single = false would work but it doesn’t seem to.
 *     ```
       <?php
       if(get_post_meta($post->ID, "photo1", $single = true) != "") :
       ?>
   
       <img src="<?php echo get_post_meta($post->ID, "photo1", $single = true); ?>" alt="<?php the_title(); ?>" />
   
       <?php
       endif;
       ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/echo-multiple-custom-fields/#post-2140024)
 * See your other thread on this subject.

Viewing 1 replies (of 1 total)

The topic ‘echo multiple custom fields’ is closed to new replies.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [get_post_meta](https://wordpress.org/support/topic-tag/get_post_meta/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/echo-multiple-custom-fields/#post-2140024)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
