I’m making a course plugin for a university in England. I’m looking to put some default placeholder text in the main post content area, on the admin side. Its the rich text editor I want it to go behind. I might just be typing the wrong words, but can’t find it here… preferably a non js thing…
Basically something like ‘Use this area to write an introduction to the course…’.
Thanks
You can change ‘post’ to which ever post type you want to apply the default content to.
Edit
I’m not sure you can add placeholder text to tinymce editors. The followng method will add a placeholder to the underlying textarea (you can view it on the ‘html’, soon to be ‘text’ tab):
But this does not appear on the visual editor (as I say, I’m not sure placeholders work with TinyMCE – if someone knows how, please comment.).
Based off a placeholder plugin I found for TinyMCE, I adapted it to work for WordPress, and created a repo specifically for it. Works perfectly for me!
https://github.com/tripflex/wp-tinymce-placeholder
This could be the answer:
http://codepen.io/flesler/pen/AEIFc
Just adding the following CSS will make it work like a placeholder:
We just need to find a way to add a data-attribute to the contenteditable element in the tinyMCE and also add the little bit of CSS to it to affect the content editable.