Horje
Add label that disappears in write post text editor  - Wordpress Solution
I would like a default label in the content text editor for write posts (back end). The label needs to disappear when you start to write in the text editor (just like the title field). I am using custom post types and would ideally like this to only show on the add custom post type (not regular posts) Notes Custom post types - woo_estate Text editor - Standard wordpress 3.1

Solution - 1

The editor is different from wordpress tinyMCE, did you use custom plugin or this default one(from new wp version)? I need to know class/id of textarea editor (if this customs plugin editor, could be different). Also custom post type name..


Solution - 2

add in your functions.php


function slh_default_text() {

global $post;
if ( $post->post_content == '' AND $post->post_type == 'post' ) {
$content = 'Enter property description here...';
		} else {
$content = $post->post_content;
	}
return $content;
}

add_filter('the_editor_content', 'slh_default_text');
if you use a custom post type naming "products" and want to use this snippet only for this custom post type, replace
$post->post_type == 'post'
with
$post->post_type == 'products'





Wordpress

Related
Search with Custom Fields in search.php - Wordpress Solution Search with Custom Fields in search.php - Wordpress Solution
WP Email Capture in WP PopUp Scheduler - Wordpress Solution WP Email Capture in WP PopUp Scheduler - Wordpress Solution
Problem with Tweetable plugin - Wordpress Solution Problem with Tweetable plugin - Wordpress Solution
My home page and sidebar content is cut off  - Wordpress Solution My home page and sidebar content is cut off - Wordpress Solution
Title Duplication Warning - Wordpress Solution Title Duplication Warning - Wordpress Solution

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8