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.

In my new custom theme I want my user to be able to add a 'customer testimony'. All I need for each entry is a plain text area for the content of the testimony and a text input for the author of the testimony (i.e. who said it). My question is what would you use to create this custom post type or something else?

My initial endeavour was to create a custom post type but without any of the normal fields. This has meant that in the column list view there is no way to link through to edit the entry as I am not using 'title'. This makes me think that I shouldn't be using custom post types for this. So should I be using creating a plugin that creates it's own database or something?

Any help would be much appreciated. Thanks.

Edit Okay could I ask for a little more help. I have put this into my save_post action:

`$my_post = array();
 $my_post['ID'] = $post->ID;
 $my_post['post_title'] = $_POST["testimony_author"];
 wp_update_post( $my_post );`

And it does make the changes to the post in the database but stalls when you actually click save on the page. Any ideas?

share|improve this question

2 Answers 2

If I were setting up this custom taxonomy, I would use only two fields: title and content. If it's there and it fits your needs then it is best to use it IMHO. Title can be used for the name of the person who wrote the testimonial and content would be used for the testimonial itself. You will have to write little to no php to get this to work and your front-end loops will look just like other WordPress loops.

share|improve this answer
    
Yeah I have thought about that but I only want the content in plain text and I guess it would take an extra step of instruction to the final user to tell them that 'title' means 'author' - but it would make my job alot easier! –  mattl May 9 '11 at 8:36
    
You could always disable the editor and then add a meta box with a plain textarea in it. –  Pippin Jul 5 '11 at 22:26

Just enable the title - you don't need to display it.

share|improve this answer
    
Yeah I would but it will just confuse the user. I either don't show it in the editing screen, in which case every testimony gets the same title - 'Draft', or I do and they feel like they have to come up with a different title for each one for no purpose! I don't like my choices! –  mattl May 6 '11 at 9:59
    
then add an action on saving that autofills the title –  anu May 6 '11 at 10:20
    
ooooo okay good idea I'll have a play - thanks! –  mattl May 6 '11 at 10:29
    
please see edit above –  mattl May 6 '11 at 11:47
    
can you post a bit more of your code - ideally the function you've hooked into save_post. –  anu May 6 '11 at 14:52

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.