WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Place Excerpt above main content window in Add New Post GUI (7 posts)

  1. bjornsennbrink
    Member
    Posted 3 years ago #

    As it says in the title, I am looking for a way to move the excerpt input area seen on wp-admin/post-new.php, from its current location below the main content window to a position just below the permalink (above the TinyMCE options bar).

    Any ideas? (Hacking the files in the wp-admin folder is not a problem.)

  2. PlugPress.com
    Member
    Posted 3 years ago #

    Unfortunately, this is not possible to move the Excerpt where you want to put it.

    It could be done by editing the core code, but you should NEVER edit the core. You would loose all your changes when you upgrade and/or could break functionality

  3. bjornsennbrink
    Member
    Posted 3 years ago #

    I am aware of the potential problems that come with hacking the core. But in this case that is not a problem. The goal (moving the input area) is more important than any extra work during upgrades.

  4. Damian Gostomski
    Member
    Posted 3 years ago #

    Although not the most ideal solution, this is definately more ideal than hacking the core...

    You can use some very basic Javascript to manipulate the DOM
    Just include the following snippet of jQuery in a JS file loaded within the admin (for the proper way to load JS in just the admin, see http://devpress.com/blog/how-to-load-javascript-in-the-wordpress-admin)

    // Move the excerpt box above the WYSIWYG editor
    jQuery(function($) {
    	var $excerpt	= $('#postexcerpt');
    	var $wysiwyg	= $('#postdivrich');
    
    	$wysiwyg.prepend($excerpt);
    });

    You'll probably also want to check that you're on the correct page (and that both of those DOM elements exist) before running the above, but it should give you an idea of what to do.

  5. bjornsennbrink
    Member
    Posted 2 years ago #

    Solution by Swedish WP dev company Xoda.

  6. Xoda
    Member
    Posted 2 years ago #

    Damian: I took your code and wrapped it in a simple plugin so one just can activate/deactivate. I'll add a thanks to you and bjornsennbrink on my page :)

  7. Phil Ewels
    Member
    Posted 2 years ago #

    For anyone using the above plugin, you can customise which post-type it's active on by swapping the if statement in the plugin with the following:

    global $current_screen;
    if($current_screen->post_type == '<POST TYPE>' && ($current_screen->action == 'add' || $current_screen->action == 'edit')){

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags