visual editor in my template
-
I am looking for a way to show a visual editor to edit/add a post from single.php
A registred user ( who are reading a post or a page ) will be able to add a little article ( to a specific category only ) and nothing more. Then a need to add a visual editor in my front-end, like single.php or footer.php… it would be like a shortcut to add posts to this category.
Then I would list the posts in this category in a section for it.
I thought to put the default wp’s editor, tinyeditor, but I got the editor area and some buttons that doesn’t work.
single.php:
<?php the_editor($whateveryouwanttoedit); ?>
functions.php:
function the_editor_enqueu() { // add libraries for editor wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); wp_print_scripts('editor'); if (function_exists('add_thickbox')) add_thickbox(); wp_print_scripts('media-upload'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); wp_admin_css(); wp_enqueue_script('utils'); do_action("admin_print_styles-post-php"); do_action('admin_print_styles'); wp_admin_css('thickbox'); } add_action('wp_head', 'the_editor_enqueu');
That is the correct way to do that?
What can I do to get this editor in my template?
- The topic ‘visual editor in my template’ is closed to new replies.