Posts: 457
Name: Randy
Location: Northern Wisconsin
|
Take a look at the codex to get familiar with the system.
To use custom fields:
1. In the custom fields area, input the name of the custom field on the "name" side.
2. On the "value" side, input the value.
Each time you make a new post or page now, this name will be stored as an option in the custom fields section. Do not be confused however, ALL custom field options you create for any post will show up for ALL posts or pages. You have the option to add a different value to it each time. Wordpress will associate that name value pair for the post.
To retrieve the custom field:
PHP Code:
<?php // retrive the value based on the name you set $field_value = get_post_meta($post->ID, 'the-custom-field-name', $single = true); // if there is data set for this custom field if($field_value !== '') { ?> // Do something here with echo $field_value; <?php } ?>
You can add multiple custom fields as well.
Good luck!
Last edited by racer x; 04-23-2010 at 10:38 AM..
|