how to add custom fields in page

Edit: Came back on this post much later but I am updating this with more correct information.

The following code will allow you to display the value of a custom field anywhere in your theme or plugin, as long as you are getting the correct post ID to pass to it. You would need to put global $post; inside your function in order to get the post ID from the global $post variable. If you have other means of getting the ID (such as get_the_ID() function), you can just use that in place of $post->ID.

<?php
    echo get_post_meta(
        $post->ID,
        'CUSTOM_FIELD_NAME',
        true
    );
?>

Old notes:

<?php echo get_post_meta($post->ID, 'CUSTOM_FIELD_NAME_HERE', true); ?>

This is the code you need. 🙂

Just put this in your theme file anywhere you want the custom value to be displayed inside of the loop, of course when you are posting, fill out the custom field text boxes accordingly.