The following describes two simple methods to enable the TinyMCE editor and QuickTag in the front-end frame. All calls are WordPress's built-in QuickTag.
Use AddQuicktag plug-in to enhance the TinyMCE editor
AddQuicktag is an enhanced plugin for the built-in TinyMCE editor of WordPress. It allows you to add custom buttons quickly. You only need to simply add the desired shortcut button, so you don't have to worry about the inconvenience caused by changing the subject. Supports visual mode and Html editing mode. Backup and recovery are also supported!
1. Search AddQuicktag on the background plug-in installation page to install the plug-in online.
2. After the plug-in is enabled, set it in the background? AddQuicktag allows you to go to the settings page and add corresponding shortcut buttons as needed.
In addition, I have posted an article about adding custom buttons to the WordPress built-in TinyMCE editor. The above details how to add QuickTag without using plug-ins. For more information, see.
Use the code to add QuickTag to the comment box
1. Create a file in the topic directory: my_quicktags.js. The content is as follows:
// Set quicktagsquicktags ({id: "comment", // The ID of the comment box, usually comment. Set buttons: "strong, em, del, link, code "// you can choose one based on your needs: strong, em, link, block, del, ins, img, ul, ol, li, code, more, spell, close}); // the default reference (block) insertion is very painful, so you have defined a QTags. addButton ('quote', 'quote', ',', 'quote'); // It defines an underscore. addButton ('u', 'u', '','', 'u ');
2. Load the jQuery library and js file, and add the following code to the topic file functions. php:
If (comments_open () & is_singular () {function zfunc_print_script () {wp_enqueue_script ('jquery '); // load the jquery library wp_enqueue_script ('quicktags '); // load js quicktagswp_enqueue_script ('My _ quicktags', get_template_directory_uri (). '/my_quicktags.js', array ('My _ quicktags', 'jquery '), '1. 0', 1, true); // load the my_quicktags.js file created in step 1} add_action ('WP _ enqueue_scripts ', 'zfunc _ print_script ');}
In this case, the figure is as follows: