WordPress.org

Ready to get started?Download WordPress

Forums

Subcategories listed incorrectly on Admin page for custom post type (6 posts)

  1. wintermute77
    Member
    Posted 2 years ago #

    I've got a custom post type set up - "Webinar" - and a whole bunch of categories with subcategories. Now, in the master category list all the categories are listed correctly with their subcategories indented under them. But on the add/edit a Webinar page, the list of category checkboxes isn't quite right: for one particular category, the subcategories aren't listed below it. They're all right at the bottom of the list, and not indented, like they're parent categories. This is only for one category - the others are all listed correctly. And even weirder, when you do tick one of the errant subcategories and update the post, it gets moved to its correct place under the parent category.

    I don't know what the cause might be. Incorrect parent ID's in the database was my first thought, but then it's displaying correctly in the master list. I don't know enough about WP's database structure to confirm.

    Any ideas?

  2. Bermuda Sam
    Member
    Posted 2 years ago #

    I am facing the same problem, but with a more simple setup:

    - No custom post type set, just a normal post
    - Any category / subcategory seems to act this way

    When creating a new post the categories are listed are they are supposed to: subcategories are nested below their parents. Selecting either the parent or the subcategory alone and publishing or saving a draft of the post like that causes the categories to be listed at the bottom of the category list without being nested like they are supposed to. It gets fixed when either the parent category or the subcategory is added and the post updated.

    Using WordPress 3.3.1 (in Finnish).

  3. han4bond
    Member
    Posted 2 years ago #

    I'm having the same problem. This is a pretty big issue, because our writers can't tell which category the errant subcategories belong to. If the subcategory is chosen, but not the parent, get_the_category doesn't return the parent, and category-specific code on the page doesn't run.

  4. kingofmycastle
    Member
    Posted 1 year ago #

    I'm having exactly the same issue (3.3.1).

    On my Category page the categories are all indented correctly. On the actual edit page the Category box isn't indented at all, until you click the parent and child and hit save. It's very confusing.

    Here's my code in functions.php Does anything look strange here?

    // Add Publication Categories
    add_action( 'init', 'create_publication_taxonomies');
    
    function create_publication_taxonomies() {
    	register_taxonomy('publication-type', 'publications', array(
    		'labels' => array(
    			'name' => _x( 'Publication Types', 'taxonomy general name' ),
    			'singular_name' => _x( 'Publication Types', 'taxonomy singular name' ),
    			'search_items' =>  __( 'Search Publication Types' ),
    			'all_items' => __( 'All Publication Types' ),
    			'edit_item' => __( 'Edit Publication Types' ),
    			'update_item' => __( 'Update Publication Types' ),
    			'add_new_item' => __( 'Add New Publication Type' ),
    			'new_item_name' => __( 'New Publication Type' ),
    			'menu_name' => __( 'Publication Types' )
    		),
    		'public' => true,
    		'hierarchical' => true,
    		'show_in_nav_menus' => false,
    		'query_var' => true,
      ));
    }
  5. kingofmycastle
    Member
    Posted 1 year ago #

    Actually I may have a fix. I changed the register_taxonomy name to 'publication_type', changed the dash to an underline. Seems to have fixed this.

    register_taxonomy('publication_type', 'publications', array(

  6. kingofmycastle
    Member
    Posted 1 year ago #

    Ha, actually it's still broken but acting completely differently, with them indented by heirarchy when not selected and appearing unindented when selected.

    No idea why. Any thoughts?

Topic Closed

This topic has been closed to new replies.

About this Topic