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 have a post on my frontpage and I want to add the TinyMCE editor to it and could not make it work.

I've tried these guides without any luck

The guides are for making it work on backend.

I guess I need to find out how to do these things...

  1. Add some Javascript with wp_enqueue_script.
  2. Add some inline Javascript settings within script-tags.
  3. Add a textarea or a div with a specific name, class or ID.

Help me in any way, code, links to guides, advice, anything.

share|improve this question
add comment

1 Answer 1

What you're looking for is two things:

  1. The wp_tiny_mce function that loads all the needed JS etc
  2. The code below:

This to setup the JS etc:

// Setup the TinyMCE stuff and target it at our desired textarea
wp_tiny_mce( true, array( "editor_selector" => 'tinymce_class' ) );

And this HTML where you need the editor box:

<div class="editor_container">
    <textarea class="large-text tinymce_class" rows="5" id="tinymce_1" name="name">
        <?php echo esc_html($value) ?>
    </textarea>
</div>
share|improve this answer
    
I've tried something like that but it gives me: "Fatal error: Call to undefined function wp_tiny_mce()" when calling it in the functions.php. Maybe the code have changed in WP 3.2? –  Jens Törnell Sep 29 '11 at 15:14
    
@Jens - Why are you be calling it in your functions file.. what are you hooking to, if anything? Everything you need is right there, so show us how you're implementing it(please). –  t31os Dec 8 '11 at 12:53
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.