WordPress.org

Ready to get started?Download WordPress

Forums

Multiple category boxes in admin area (3 posts)

  1. studio-racket
    Member
    Posted 5 years ago #

    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

  2. studio-racket
    Member
    Posted 5 years ago #

    Anyone...? Has anyone tried to do something similar to this in the past?

  3. apam
    Member
    Posted 4 years ago #

    I had a similar problem and found some info on this page:
    http://www.nabble.com/Multiple-category-boxes---tabs-in-the-Admin-Area-td23286568.html

    and in the end comfort from this plugin:
    http://wordpress.org/extend/plugins/custom-taxonomies/

    hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Topic