WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Hide/move custom meta boxes

[Resolved] Hide/move custom meta boxes

  • Hey all,

    I’m trying to neaten up the back end of my site where I have added a few pages, and I’m trying to make my meta boxs all swish and nifty like the one on the Dashboard for example (where you can drag them and move them around).

    I found some example code but can’t seem to get it to work – just wondering if anybody is able to spot any errors/omisisons with the below code?

    Thanks.

    <div id="screen-main-container" class="wrap">
    
    	<?php screen_icon('options-general') ?>
    	<h2>Screen Title</h2>
    	<?php write_custom_admin_message($message, $class); ?>
    
    	<div id="cudtom-branding" class="metabox-holder">
    
    		<div class="postbox-container" style="width: 49%;">
    
    			<div id="normal-sortables" class="meta-box-sortables">
    
    				<div id="meta-box-id-1" class="postbox">
    					<div class="handlediv" title="Click to toggle"><br /></div>
    					<h3>Header</h3>
    					<div class="inside">
    						{meta-box contents go here}
    					</div>
    				</div>
    
    				<div id="meta-box-id-2" class="postbox">
    					<div class="handlediv" title="Click to toggle"><br /></div>
    					<h3>Login Screen</h3>
    					<div class="inside">
    						{meta-box contents go here}
    					</div>
    				</div>
    
    			</div>
    
    		</div>
    
    	</div>
    
    </div>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Ok, so found this tutorial and associated example plugin – the English isn’t perfect, but the example was easy to follow and to make amendments to.

    Same tutorial i followed when i first did it.. 😉

    Personally i’ve found the overhead of loading all the required scripts to not be worth it.. unless your plugin really needs that functionality…

    For most things a little custom written jQuery ends up being a whole lot lighter..

    Is there a way to have some admin panels minimized/collapsed by default?

    Thanks

    WebTechGlobal
    Participant

    @webtechglobal

    jayc that is easy done using the class…

    <div class=”postbox closed”>

    and

    <div class=”postbox”>

    Obviously with a bit of php you could make it more dynamic, say if there is a form within your postbox and it has been submitted but you want the user to return to the form, you would also want the postbox to stay open.

    Used such approaches in Easy CSV Importer, one page has a list of 8 post boxes each with forms.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Hide/move custom meta boxes’ is closed to new replies.