Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds an image above the title on the WordPress post editing screen.
<?php
/*
Plugin Name: Image Above Title
Plugin URI: http://pmg.co
Description: Adds an image above the title on the WordPress post editing screen.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: creative commons/GPL2
*/
add_action( 'dbx_post_sidebar', 'wpse27700_add_image' );
function wpse27700_add_image()
{
echo '<img id="wpse27700-image" src="http://placebear.com/500/100" alt="wpse27700 bear" style="display:none;" />';
}
add_action( 'admin_head', 'wpse27700_admin_head' );
function wpse27700_admin_head()
{
?>
<script type="text/javascript">
jQuery(document).ready(function(){
var wpse27700 = jQuery('#wpse27700-image');
wpse27700.remove();
jQuery('#titlediv #titlewrap').before(wpse27700.show());
});
</script>
<?php
}
@Otto42

This comment has been minimized.

Copy link

@Otto42 Otto42 commented Dec 23, 2011

+1 for placebear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.