Title: [Plugin: Custom Field Template] Displaying on Post
Last modified: August 20, 2016

---

# [Plugin: Custom Field Template] Displaying on Post

 *  [nlck1](https://wordpress.org/support/users/nlck1/)
 * (@nlck1)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-displaying-on-post/)
 * Hello,
    I have problems with the fields showing up on the posts. I’m not really
   good with php. What I have been doing is putting this into the bottom of functions.
   php (theme functions.php)
 *     ```
        function getCustomField($theField) {
       	global $post;
       	$block = get_post_meta($post->ID, $theField);
       	if($block){
       		foreach(($block) as $blocks) {
       			echo $blocks;
       		}
       	}
       }
       ```
   
 * And this into single.php
 *     ```
       <?php getCustomField('Day Number'); ?>
       ```
   
 * This is my settings.
 *     ```
        [Day Number]
       type = text
       size = 10
       output = true
       ```
   
 * I’m using Suffusion theme and I have no idea what I’m doing wrong.
 * Thanks in advance
 * [http://wordpress.org/extend/plugins/custom-field-template/](http://wordpress.org/extend/plugins/custom-field-template/)

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

 *  Thread Starter [nlck1](https://wordpress.org/support/users/nlck1/)
 * (@nlck1)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-displaying-on-post/#post-2178042)
 * Update:
    Found that I should only need to add
 *     ```
       <?php echo get_post_meta($post->ID, 'Your Field Name', true); ?>
       ```
   
 * to the template but I have no idea which file or line.
 * Thanks.
 *  [Tara Rotten](https://wordpress.org/support/users/tara-rotten/)
 * (@tara-rotten)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-displaying-on-post/#post-2178401)
 * Hey
 * Do you know how to add the custom field name as well as the field content
    e.
   g:
 * Day Number: field content
 * ??
 *  [blitz999](https://wordpress.org/support/users/blitz999/)
 * (@blitz999)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-displaying-on-post/#post-2178402)
 * Yes, this takes a little getting your head round.
 * Nick1. Your code goes into the page (ie: page.php or single.php) in the position
   you want it to show.
 * I’m trying to get these custom fields to show in a widget – anyone know how to
   do that?

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

The topic ‘[Plugin: Custom Field Template] Displaying on Post’ is closed to new 
replies.

 * ![](https://ps.w.org/custom-field-template/assets/icon-256x256.png?rev=1966286)
 * [Custom Field Template](https://wordpress.org/plugins/custom-field-template/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-field-template/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-template/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-template/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-template/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-template/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [blitz999](https://wordpress.org/support/users/blitz999/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-displaying-on-post/#post-2178402)
 * Status: not resolved