How to put placeholder text in the main post input area?

You can change ‘post’ to which ever post type you want to apply the default content to. add_filter( ‘default_content’, ‘wpse57907_default_content’, 10, 2 ); function wpse57907_default_content( $content, $post ) { if ( ‘post’ == $post->post_type ) $content=”Use this area to write an introduction to the course…”; return $content; } Edit I’m not sure you can add … Read more

Custom rewrite rule for backend/admin?

In general, it is possible, but you need to define ADMIN_COOKIE_PATH in your wp-config.php to the value / which might cause security issues. First of all define this rewrite rules in your .htaccess right before the rewrite rule of wordpress: # Make sure, there is a trailing slash RewriteRule ^submit-project/add$ submit-project/add/ [R=301,L] # mask the … Read more

Change Dashboard url

Without Plugin: 1. Add constant to wp-config.php define(‘WP_ADMIN_DIR’, ‘admin-area’); define(‘SITECOOKIEPATH’, preg_replace(‘|https?://[^/]+|i’, ”, get_option(‘siteurl’) . “https://wordpress.stackexchange.com/” ) ); define(‘ADMIN_COOKIE_PATH’, SITECOOKIEPATH . WP_ADMIN_DIR); 2. Add below filter to functions.php add_filter(‘site_url’, ‘wpadmin_filter’, 10, 3); function wpadmin_filter( $url, $path, $orig_scheme ) { $old = array( “/(wp-admin)/”); $admin_dir = WP_ADMIN_DIR; $new = array($admin_dir); return preg_replace( $old, $new, $url, 1); } … Read more

Add confirmation popup on “Move to Trash”

You can try to admin enqueue this script, with jquery dependency: jQuery( function($) { $(‘.edit-php a.submitdelete, .post-php a.submitdelete’).click( function( event ) { if( ! confirm( ‘Are you sure you want to move the post to trash?’ ) ) { event.preventDefault(); } }); }); where we restrict the conformation on the a.submitdelete clicks to the .edit-php … Read more

Edit image preview is not displayed

By default, wp-config.php might not have a closing tag ?> and this is acceptable and by design. The issue may arise from whitespace in some other .php file. In my case, I had whitespace after the closing tag of my functions.php file for my child theme. Once I removed that whitespace, the images are showing … Read more

Use a textarea for a custom post type

You forgot to add name =”bizdesc” to your textarea, so this function DrawCallBack($post) { $Record = GetDBRecord(); echo ‘<textarea id=”bizdesc” rows=”2″ cols=”50″>’; echo $Record[‘BizDescp’]; echo ‘</textarea>’; echo ‘<input type=text id=”YourName” name=”YourName” value=”‘ .$Record[‘Name’] .'”/>’ } should be function DrawCallBack( $post ) { $Record = GetDBRecord(); echo ‘<textarea name=”bizdesc” id=”bizdesc” rows=”2″ cols=”50″>’; echo esc_textarea( $Record[‘BizDescp’] ); … Read more

Move WP Admin Bar

The admin bar is hooked to wp_footer. So … remove_action( ‘wp_footer’, ‘wp_admin_bar_render’, 0 ); … will remove it from there. And then you can register it for a custom hook with: add_action( ‘my_custom_hook’, ‘wp_admin_bar_render’, 1000 ); You still have to overwrite the CSS in your stylesheet, but that should be fairly simple. Oh, and welcome … Read more

Add custom text to Page Tamplate without need to know html

You have two solutions for this: Use Custom Fields This is a very comprehensive guide: The Power of WordPress Custom Fields. There are some very useful plugins like Custom Field Template and Magic Fields which use them. Use Widgets. The Widgets API allows you to easily build your own widgets.