Title: Custom Field Array returning extra content &#8211; Why?
Last modified: August 19, 2016

---

# Custom Field Array returning extra content – Why?

 *  [Paul](https://wordpress.org/support/users/paulburd/)
 * (@paulburd)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/custom-field-array-returning-extra-content-why/)
 * I’m not a PHP guy, but I pieced together this script. It works, but it returns
   extra content… in the for of the number “1”.
 *     ```
       <?php
       $sidemodule_values = get_post_custom_values('sidemodule'); 
   
       if ($sidemodule_values[0]=="") {
       include(TEMPLATEPATH . "/sidemodules/test3.php");
       include(TEMPLATEPATH . "/sidemodules/test4.php");
       }
       else {
       foreach ( $sidemodule_values as $key => $value )
           echo include(TEMPLATEPATH . "/sidemodules/$value.php");
       }
       ?>
       ```
   
 * I have two instances of the “sidemodule” custom field set up on a page with values
   of “test1″ and test2”. Here’s what I get back when the page is rendered:
 * `<p>content (from test1.php)</p>1<p>content (from test2.php)</p>1`
 * Everything works fine in terms of the content from the two external files is 
   being displayed, but each block is followed by “1”.
 * I’ve tried several variations and I can’t figure out why. Any suggestions would
   be appreciated.
 * Basically I’m setting up a sidebar that will have default content that will be
   included unless custom fields have been applied to override it.

The topic ‘Custom Field Array returning extra content – Why?’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Paul](https://wordpress.org/support/users/paulburd/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/custom-field-array-returning-extra-content-why/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
