Title: Custom Field Outputting Array
Last modified: August 20, 2016

---

# Custom Field Outputting Array

 *  Resolved [bjdavids649](https://wordpress.org/support/users/bjdavids649/)
 * (@bjdavids649)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/custom-field-outputting-array/)
 * At [my test site,](http://www.barbdavids.com/dev/yachts) I am trying to do different
   backgrounds for each page.
 * I have a custom field called background-image with a url from the media area.
 * I have the following just have the header call and before content:
 * > <style type=“text/css”>
   >  body { background-image: url(‘<?php echo get_post_meta(
   > $post->ID, ‘background-image‘, true); ?>’); } </style>
 * I don’t see it’s working and when I look at the code, it’s outputs:
 * > <style type=“text/css”>
   >  body { background-image: url(‘Array’) } </style>
 * I cannot figure out what I’m doing wrong. I’ve tried Googling the answer but 
   all information indicates I’m doing the right thing.
 * Any ideas?
 * Thanks,
    Barb

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [bjdavids649](https://wordpress.org/support/users/bjdavids649/)
 * (@bjdavids649)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/custom-field-outputting-array/#post-2478080)
 * I found out that my quotes around the background-image were of a difference character.
   I deleted them and retyped and now am seeing the right source, no more Array…
   except… I’m still not seeing my background? Ugh!
 *  Thread Starter [bjdavids649](https://wordpress.org/support/users/bjdavids649/)
 * (@bjdavids649)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/custom-field-outputting-array/#post-2478081)
 * I GOT IT!
 * Changed the header.php file body line to:
 * > <body <?php body_class(); ?> style=”background-image: url(‘<?php echo get_post_meta(
   > $post->ID, ‘background-image’, true); ?>’);”>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Field Outputting Array’ is closed to new replies.

## Tags

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

 * 2 replies
 * 1 participant
 * Last reply from: [bjdavids649](https://wordpress.org/support/users/bjdavids649/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/custom-field-outputting-array/#post-2478081)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
