(This is really a PS to the previous post)
The following code can be placed anywhere in your php to call data entered in the custom field section of your post/page editing area. For example you could place it within your ‘head’ tags to include keywords for SEO.
The function name I’ve called ‘customfunction’ (can be anything unique). In the dashboard I’ve used ‘custom_field as the ‘key’ or ‘name’…
<?php $customfunction = get_post_meta($post->ID, 'custom_field', true); ?>
<?php if ($customfunction != "") { ?>
<?php echo $customfunction ?>
<?php } ?>
and the value is what ever you want include. For example…
<meta name="keywords" content="Penfold, wordpress, very, handsome, boffin, surfer">
This isn’t limited to the header, it can be used to call anything to any part of your site on an individual post or page. Such as sidebars or widgets…