Title: small PHP Syntax issue with custom field
Last modified: August 19, 2016

---

# small PHP Syntax issue with custom field

 *  [brittgamil](https://wordpress.org/support/users/brittgamil/)
 * (@brittgamil)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/small-php-syntax-issue-with-custom-field/)
 * Hello! I am trying to use a piece of script to a template from the Facebook Photo
   Fetcher plugin and insert a number from a custom field so that different albums
   can be placed on different pages.
 * That may be confusing, but I think the solution is simple and just a little syntax
   problem on my end 🙂
 * Here is the original code. I placed this as is in my template file and it loads
   perfectly on the page.
 *     ```
       <?php    $album = fpf_fetch_album_content( '315484822640', array('isPage'=>1, 'cols'=>3, 'rand'=>6, 'hideHead'=>1) );
       echo "<a href='javascript:document.location.reload();'><small><em>refresh the page for new images</em></small></a>";
       echo $album['content'] ?>
       ```
   
 * Now what I want to do is replace the number `'315484822640'` with a number from
   a custom field input.
 *     ```
       <?php if(get_post_meta($post->ID, 'facebook number', true)) : ?>
   
       <?php    $album = fpf_fetch_album_content( '   <?php echo get_post_meta($post->ID, 'facebook number', true); ?> ', array('isPage'=>1, 'cols'=>3, 'rand'=>6, 'hideHead'=>1) );
       echo "<a href='javascript:document.location.reload();'><small><em>refresh the page for new images</em></small></a>";
       echo $album['content'] ?>
   
                       <?php else : ?>
                       <?php endif; ?>
       ```
   
 * The problem in the code is putting a “<?php…..?>” inside another “<?php…..?>”
 * any help would be greatly appreciated!

The topic ‘small PHP Syntax issue with custom field’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [brittgamil](https://wordpress.org/support/users/brittgamil/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/small-php-syntax-issue-with-custom-field/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
