• Hi all,

    I have been building a real estate type site which will be populated and maintained by multiple authors… hence I have tried to make the admin are as simple and logical as possible. All of the sites content is being entered as ‘posts’ with categories being used as a structural devices. So, getting to my point… I hacked the edit-form-advanced.php and duplicated the <?php wp_category_checklist(0,3) ?> to create an effect similar to this

    While this works fine initially, except… when you go back and edit a published post, wordpress does not show you which categories have been selected – the categories are all selected fine… you just cant see what they are… does that make sense? Here is the full code from the admin area:

    function post_categories_meta_box($post) {
    ?>
    
    <div id="cat-type">
    <div id="category-adder" class="wp-hidden-children">
    	<h4>Choose One Space Type Only.</h4>
    </div>
    
        <ul id="category-tabs">
            <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'Space Type' ); ?></a></li>
        </ul>
    
        <div id="categories-all" class="ui-tabs-panel">
            <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    			<?php wp_category_checklist(0,3) ?>
            </ul>
        </div>
    </div>
    
    <div id="cat-usage">
        <ul id="category-tabs">
            <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'Space Usage' ); ?></a></li>
        </ul>
    
        <div id="categories-all" class="ui-tabs-panel">
            <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
                <?php wp_category_checklist(0,8) ?>
            </ul>
        </div>
    </div>
    
    <ul id="category-tabs">
    	<li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'Space Suburb' ); ?></a></li>
    </ul>
    
    <div id="cat-suburb" class="ui-tabs-panel">
    	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    		<?php wp_category_checklist(0,17) ?>
    	</ul>
    </div>

    My question is… what have I screwed up in duplicated the category selectors?

    And secondly… has anyone else ever attempted something similar to this… I fully admit my way is quick and dirty… Does anyone know of a more sophisticated way of doing this?

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple category boxes in admin area’ is closed to new replies.