WordPress.org

Ready to get started?Download WordPress

Forums

Increase Number of Columns on Edit Post screen (29 posts)

  1. larrythefox
    Member
    Posted 3 years ago #

    I'm wondering if theres a way to hack the Edit Post screen to allow a 3rd (or even 4th) column, like the dashboard has.

    Let me preface this, I use a 20" monitor and surf with my browser maximized.

    The Problem:
    I have no need for a 1000px+ wide text editor and would rather make it smaller and gain an extra column to organize the options better.

    Solution:
    Ideally have 3 columns on the Edit Post screen, the first slightly larger for the body text, and two smaller ones next to it for all the options.

    Has the added benefit of not having to scroll down to access all the options for a post. Plus it would help the proofreading/typing process as ideal line length is something around 12-16 words. Right now in my case it's about double that. Which makes reading and proofing a pain. I don't want to have to change my browser size just to make a post.

    Aside:
    I'm honestly surprised this hasn't been included in the core already, it's a waste of valuable space for people with wide monitors, and has been bugging me for a long time. I don't imagine it would be hard to implement either.
    I think the whole admin side should just dynamically adjust columns based on screen width so I can seamlessly go from my netbook to my desktop, with out having to change settings every time.

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    Hi Larry,

    Although i spend most of my time on a laptop i can appreciate what you're saying, when i'm at another PC with a larger screen it makes more sense to utilise the extra width, i wouldn't mind an option for more columns when the screen can utilise it.

    I took at look at some of the underlying code and it appears the postbox javascript at least supports upto 4 columns(per the dashboard), the only area lacking support is the post editor screen, specifically edit-form-advanced.php.

    I'd suggest posting an idea on the ideas section.
    http://wordpress.org/extend/ideas/

    Or if you're code literate a feature request on Trac with a patch.
    http://core.trac.wordpress.org/

    This is only intended as a proof of concept to show how it would work(the code below is a quick hack), and does require a core file modification..

    First open, wp-admin/edit-form-advanced.php, find this line...

    $side_meta_boxes = do_meta_boxes($post_type, 'side', $post);

    And add the following code before it..

    if( 'post' == $post_type )
        $side_meta_boxes2 = do_meta_boxes( 'post', 'column3', $post );

    Then add the following to your theme's functions.php file.

    add_action( 'admin_head-post.php', 'testing_extra_column' );
    function testing_extra_column() {
    	global $post_type;
    	if( $post_type != 'post' )
    		return;
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($){
    	$('#side-info-column').css('width','601px');
    	$('#post-body').css('margin-right','-640px');
    	$('#post-body-content').css('margin-right','620px');
    	$('#column3-sortables').prepend('Column 3 is here').css({'width':'300px','float':'right'});
    });
    </script>
    <?php
    }

    You'll at least get to see what it would look like it WordPress supported an extra column... bearing in mind that's what i've thrown together over the course of 10 minutes.

  3. larrythefox
    Member
    Posted 3 years ago #

    Hey mark thanks for your help!
    I'll try this out on my local install a little later tonight.

    Have never posted a feature request on trac, but would really love to see this added to the core.

  4. Marcus Downing
    Member
    Posted 3 years ago #

    I'd love to see this too. When using WordPress as a general purpose CMS, rather than a mere blogs, the amount of metadata, taxonomies and custom fields inevitably increase. The option of a third column to organise them in would be helpful.

    What would be extra neat would be the capacity to arrange two columns underneath the content box, like so:

    |------------------|-----|
    |   main content   | rhs |
    |------------------|     |
    |  col 1  |  col2  |     |
    |---------|--------|-----|
  5. wob
    Member
    Posted 3 years ago #

    I would love this aswell

  6. Mark / t31os
    Moderator
    Posted 3 years ago #

    Perhaps someone could start by adding the request on the ideas section.
    http://wordpress.org/extend/ideas/

    Your login there is the same as in the forum.

    :)

  7. Marcus Downing
    Member
    Posted 3 years ago #

  8. Mark / t31os
    Moderator
    Posted 3 years ago #

    You have my vote! And i'd encourage anyone who supports this idea to cast their votes over on the ideas section to... :)

  9. Marcus Downing
    Member
    Posted 3 years ago #

    Based on Mark's hack code, I created a plugin to do this: third-column.zip. It's very simple (the code is shorter than the copyright notice) but has the advantage of not editing any core files. If people approve, I'll publish it for real.

  10. wob
    Member
    Posted 3 years ago #

    Hi Marcus,

    The zip is empty

  11. Marcus Downing
    Member
    Posted 3 years ago #

    Ahem. Bug number one fixed. :)

  12. wob
    Member
    Posted 3 years ago #

    Works great, thanks!

  13. wob
    Member
    Posted 3 years ago #

    Any idea how to apply the third column for just a certain post type?

  14. Marcus Downing
    Member
    Posted 3 years ago #

    I could add a settings page for it, or you could edit the plugin code yourself - it's pretty simple.

    There is already a setting in the header for the number of columns, I wonder how it might hook into that?

  15. Mark / t31os
    Moderator
    Posted 3 years ago #

    Here's a single file version that can be easily copied into your functions file.
    http://pastebin.com/4CY3hRx3

    Uncomment the two commented lines to apply the code to a specific post type..

  16. wob
    Member
    Posted 3 years ago #

    Thanks Mark,

    However, it still loads the css (obviously) even on the types that are not specified.

  17. Mark / t31os
    Moderator
    Posted 3 years ago #

    Add the following at the top of the third_column_css function.

    global $post_type;
            if( 'your-type' != $post_type )
                  return;

    So it looks like so..

    function third_column_css () {
            global $post_type;
            if( 'your-type' != $post_type )
                  return;
            ?>

    Oversight on my part... :)

  18. Ethan Shaw
    Member
    Posted 2 years ago #

    Wow thanks Marcus!

  19. cedric.charles
    Member
    Posted 2 years ago #

    Hellow everyone :) !

    In the same idea, I would like to force just one column in the dashboard... Right now, my dashboard widgets are set in the left column, but the user can still drag and drop a widget in an other column, and I don't want that :/ !

    If possible, I want something that I can put in the function.php, not a plugin.

    Thanks a lot.

  20. ekdor
    Member
    Posted 2 years ago #

    The plug-in link has gone dead. I would really like the plug-in thanks.

  21. ekdor
    Member
    Posted 2 years ago #

    I can't say I like the ideas of messing with the WP install directly but i'm going to give it a shot. @ Mark, I asume your functions code goes into the functions file located in the wp-includes functions file? I guess I'll find out soon. Also I assume this needs to be repeated every time WordPress update? Cheers, Brook

  22. ekdor
    Member
    Posted 2 years ago #

    oops it broke!

  23. Mark / t31os
    Moderator
    Posted 2 years ago #

    The code would go into your theme's functions.php file (example: wp-content/themes/default/functions.php), but you'd also need to edit one of the core wordpress files as i indicated in my earlier response(wp-admin/edit-form-advanced.php).

    For code, use this.
    http://pastebin.com/4CY3hRx3

    Plus, the adjustment i mentioned here.
    http://wordpress.org/support/topic/increase-number-of-columns-on-edit-post-screen?replies=22#post-2067386

  24. ekdor
    Member
    Posted 2 years ago #

    @mark

    Sorry I missed that post. Will try again another day and let you know what result I get.

    Cheers, brook.

  25. Marcus Downing
    Member
    Posted 2 years ago #

    I've published my solution as a real plugin. It does not require you to modify the code of WordPress itself in any way.

    http://wordpress.org/extend/plugins/third-column/

  26. ekdor
    Member
    Posted 2 years ago #

    OK: Thanks to everyone involved with this.

    @ Mark - Thanks heaps for your quick responses.
    @ Marcus - That works great!

    Cheers,. Brook

  27. Marcus Downing
    Member
    Posted 2 years ago #

    You're welcome. It is quite a tricky, messy hack to add it without core support, which is no doubt why Mark didn't believe it was possible. It would still be vastly better (less hacky and more reliable) if WordPress had built-in support for this.

  28. ekdor
    Member
    Posted 2 years ago #

    Yes they should. They might at some point.

  29. GeekPress
    Member
    Posted 2 years ago #

    Oh Good !!

    Thanks for the tips :)

Topic Closed

This topic has been closed to new replies.

About this Topic