Custom Fields to display website name and URL
-
I would like to be able to use custom fields to display a list of associated websites that belong with a particular post
This displays the keys:
<?php $custom_field_keys = get_post_custom_keys(); foreach ( $custom_field_keys as $key => $value ) { $valuet = trim($value); if ( '_' == $valuet{0} ) continue; echo $key . " => " . $value . "<br />"; } ?>
I know this displays the keys from the meta data, but I want to able to display both the keys and the values in a particular way.
Something like this, but its not working for me:
<?php $get_post_custom($post_id); foreach ($key && $value) { if ( '$key' != 'keywords' || '$key' != 'description' || '$key' != 'title') continue; <a href="<?php echo $key ?>"><?php echo $value ?></a> } ?>
(I am also trying to exclude 3 types of meta data from being displayed)
I know I’m way off here, but I wanted to give an example of what I’m trying to accomplish.
Any help would be greatly appreciated!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom Fields to display website name and URL’ is closed to new replies.