Title: [Plugin: Custom fields shortcode] php include function   this plug in
Last modified: August 19, 2016

---

# [Plugin: Custom fields shortcode] php include function this plug in

 *  [utunlimited](https://wordpress.org/support/users/utunlimited/)
 * (@utunlimited)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/plugin-custom-fields-shortcode-php-include-function-this-plug-in/)
 * Hi
 * Hope you can help
    How can I write a html/css/php (whatever will work) that can
   be referenced by every page. I have written my own html file “cfields”.
 * This is in my page template
    `<?php include("cfields.html"); ?>`
 * cfields.html
 *     ```
       <html>
       <head>
       </head>
       <p>Score: </p>[cf]score[/cf]
       </html>
       ```
   
 * It gives:
 *     ```
       Score:
       [cf]score[/cf]
       ```
   
 * Where am I going wrong.
 * cheers
 * [http://wordpress.org/extend/plugins/custom-fields-shortcode/](http://wordpress.org/extend/plugins/custom-fields-shortcode/)

Viewing 1 replies (of 1 total)

 *  [veeco](https://wordpress.org/support/users/veeco/)
 * (@veeco)
 * [17 years ago](https://wordpress.org/support/topic/plugin-custom-fields-shortcode-php-include-function-this-plug-in/#post-1030443)
 * I believe what you are trying to do is simply insert a custom field into a template?
   To do so, you just need to have the right php code in your template to grab the
   custom field:
 * [http://codex.wordpress.org/Using_Custom_Fields](http://codex.wordpress.org/Using_Custom_Fields)
 * Should look like this:
 *     ```
       <?php $key="score"; $result= get_post_meta($post->ID, $key, true); ?>
       <p>Score: </p> <?php echo $result ?>
       ```
   
 * This code needs to be in a template and within the if (have_posts()) … section
   of code.
 * The plugin you are referencing is for creating custom fields and inserting them
   directly into a post or page, not a template.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Custom fields shortcode] php include function this plug in’ 
is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [veeco](https://wordpress.org/support/users/veeco/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/plugin-custom-fields-shortcode-php-include-function-this-plug-in/#post-1030443)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
