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.

probably a rather weird question but I have no idea if this is possible or not!?

I created a custom-post-type to handle events. An event always has a future date but once this date is over I want to be able to write a review of the event and add this to the post itself.

So imagine an event as a kind of group of two posts. The first post is the one when it get's published. With a description of the event, a date of the event, etc.

Once the event is over I somehow would like to write a "recap" of the event - how it was, some photos, etc.

Do you generally have any idea how I could solve this? So that the same event-post suddenly has a kind of "subpost" with a review in it?

I was wondering if I could solve this via a custom-field that adds a completely new instance of the TinyMCE editor underneath the already existing one. So that I could write two posts inside of one post? Sounds silly I know. But then I would have one event-link that (if the date of the event is over) would have a somehow differently formatted second post-item with the review of the event in it!

Any ideas on that? How could I solve such a thing? Thank you!

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I believe this answers both of your questions(this and this), Take a look at My Meta box class which lets add nay type of field you want in a custom metabox.

Once you have the class all you need to do is something like this:

//include the main class file
require_once("meta-box-class/my-meta-box-class.php");
// configure your meta box
$config = array(
    'id' => 'event_review_box',             // meta box id, unique per meta box
    'title' => 'Event Review',          // meta box title
    'pages' => array('event'),          // post types, assuming that your post type name is event
    'context' => 'normal',              // where the meta box appear: normal (default), advanced, side; optional
    'priority' => 'high',               // order of meta box: high (default), low; optional
    'fields' => array(),                // list of meta fields (can be added by field arrays) or using the class's functions
    'local_images' => false,            // Use local or hosted images (meta box images for add/remove)
    'use_with_theme' => false           //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
);
// Initiate your meta box
$my_meta2 = new AT_Meta_Box($config);
//Add fields to your meta box
$my_meta2->addWysiwyg('wysiwyg_field_id',array('name'=> 'Event Recap'));
//Finish Meta Box Deceleration
$my_meta2->Finish();

then to add a new metabox for the event date field

// configure your meta box
$config = array(
    'id' => 'event_date_box',           // meta box id, unique per meta box
    'title' => 'Event date',            // meta box title
    'pages' => array('event'),          // post types, assuming that your post type name is event
    'context' => 'normal',              // where the meta box appear: normal (default), advanced, side; optional
    'priority' => 'high',               // order of meta box: high (default), low; optional
    'fields' => array(),                // list of meta fields (can be added by field arrays) or using the class's functions
    'local_images' => false,            // Use local or hosted images (meta box images for add/remove)
    'use_with_theme' => false           //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
);
// Initiate your meta box
$my_meta = new AT_Meta_Box($config);
//Add fields to your meta box
$my_meta->addDate('date_field_id',array('name'=> 'Event Date '));
//Finish Meta Box Deceleration
$my_meta->Finish();

and you get something that looks like this: enter image description here

share|improve this answer
    
Just wow! Thank you! This helps a lot! Would be really cool though to have the same date-picker as for the postdate. Maybe you think about it for future releases of your class. Thanks a lot! –  mathiregister Apr 9 '12 at 15:36
    
Is it possible to use German date format with your date and time pickers? –  mathiregister Apr 10 '12 at 9:25
    
The class can handle any of the format types listed here docs.jquery.com/UI/Datepicker/$.datepicker.formatDate –  Bainternet Apr 10 '12 at 11:23
    
Ok, thank you very much. Two more questions though. My site is about events as you read above - therefore I want to list all events and sort them by their event-date. I use text_date right now and changed it to my desired date-format - just perfect. However do you have any idea how I could sort my posts by this event-date in the right order? –  mathiregister Apr 10 '12 at 12:07
    
if you want to sort based on the date you should save the date in a unix timestemp format then you should be able to short based on the date. –  Bainternet Apr 10 '12 at 13:08
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.