Title: Adding cfs code to template breaks template
Last modified: August 20, 2016

---

# Adding cfs code to template breaks template

 *  Resolved [smlombardi](https://wordpress.org/support/users/smlombardi/)
 * (@smlombardi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/)
 * As soon as I add ANY cfs related code to my PHP template, the template from that
   point forward soes not print out. That is, no further html is printed, leaving
   divs open, sidebar missing, etc.
 * Even adding only “php global $cfs” causes this. What am I missing?
 * [http://wordpress.org/extend/plugins/custom-field-suite/](http://wordpress.org/extend/plugins/custom-field-suite/)

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

 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/#post-3524160)
 * Please paste your entire template code to pastebin.com. I need to see your code
   in order to help diagnose.
 *  Thread Starter [smlombardi](https://wordpress.org/support/users/smlombardi/)
 * (@smlombardi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/#post-3524162)
 * I discovered that it doesn’t work in the default nested-template structure of
   Twenty Eleven, as in `<?php get_template_part( 'content', 'single' ); ?>`
 * When i put cfs code in content-single.php, I get the errors. However, if I delete
   that php and move all my content code into the parent single.php it works as 
   advertised.
 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/#post-3524230)
 * Right, templates called using `get_template_part` don’t recognize the $cfs variable,
   hence the need to add `<?php global $cfs; ?>` at the top of your file.
 *  Thread Starter [smlombardi](https://wordpress.org/support/users/smlombardi/)
 * (@smlombardi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/#post-3524231)
 * Yes, but do I add it to the php file that contains `get_template_part`? If I 
   add it to the template part, I get the error.

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

The topic ‘Adding cfs code to template breaks template’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [smlombardi](https://wordpress.org/support/users/smlombardi/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/adding-cfs-code-to-template-breaks-template/#post-3524231)
 * Status: resolved