Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm extremely new to WP. I want to add an extra field to the Post interface and show the content on a template. I don't want to show the content of the Post, but just the content in the extra field.

Basically what I'm trying to achieve is design a Customer Testimonial page on my website where I show the full testimonial using the extra field, and show the post content as the mini testimonial if you get what Im saying. Please let me know if I need to clarify more. Thanks heaps. I tried custom fields in WP, but not sure how to grab the extra content only. is there a plug out there for this?

share|improve this question
add comment

2 Answers

You can use a custom field eaisly then call into the template
(the image shows custom field <-- my installation is in hebrew but would look the same and apears under the editor)

enter image description here

Then you can get the value of the field like so...

Inside the loop

<?php
$key="customField"; 
echo get_post_meta($post->ID, $key, true);
?>

Outside the loop

<?php
global $wp_query;
$postid = $wp_query->post->ID;

// mykey = field name

$key="customField";
$result = get_post_meta($postid, $key, true);
echo $result;
?>

.
Hope this helps... i would use custom post type but
this is the easy way to add a field to a post

Good Luck, Sagive.

share|improve this answer
add comment

You can use the built-in custom fields in WordPress as mentioned above, I also personally recommend Advanced Custom Fields. A great plugin with tons of useful documentation and a pretty active support area. Thanks!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.