WordPress: Add Preview Button in Distraction Free Writing

Print View Mobile View

This code snippet adds a preview button to the right of the Save button in Distraction Free Editor in WordPress.
dfw preview button

function dfw_preview_button() {
<script type="text/javascript">
;(function($) {
	var $preview = $('#post-preview');
		.css('margin-left', '5px')
		.click(function(e) {
		.insertBefore('#wp-fullscreen-save input.button-primary');
add_action('admin_footer-post-new.php', 'dfw_preview_button');
add_action('admin_footer-post.php', 'dfw_preview_button');

Drop the code in your active theme’s functions.php file. (via)