WordPress.org

Ready to get started?Download WordPress

Forums

echo multiple custom fields (2 posts)

  1. markoburns
    Member
    Posted 3 years ago #

    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;
    ?>
  2. vtxyzzy
    Member
    Posted 3 years ago #

    See your other thread on this subject.

Topic Closed

This topic has been closed to new replies.

About this Topic