• Resolved davidbicton

    (@davidbicton)


    I am unable to set a parent-child relationship on my custom post type “specials”
    I have Hierarchical set to true and also have tried several different codes found in my functions.php with no luck.

    Does anyone know how to get this to work?

    Thanks,

    David

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter davidbicton

    (@davidbicton)

    function cptui_register_my_cpts_specials() {

    /**
    * Post Type: Specials.
    */

    $labels = [
    “name” => __( “Specials”, “hello-elementor-child” ),
    “singular_name” => __( “Special”, “hello-elementor-child” ),
    ];

    $args = [
    “label” => __( “Specials”, “hello-elementor-child” ),
    “labels” => $labels,
    “description” => “”,
    “public” => true,
    “publicly_queryable” => true,
    “show_ui” => true,
    “show_in_rest” => true,
    “rest_base” => “”,
    “rest_controller_class” => “WP_REST_Posts_Controller”,
    “has_archive” => false,
    “show_in_menu” => true,
    “show_in_nav_menus” => true,
    “delete_with_user” => false,
    “exclude_from_search” => false,
    “capability_type” => “post”,
    “map_meta_cap” => true,
    “hierarchical” => true,
    “rewrite” => [ “slug” => “/”, “with_front” => true ],
    “query_var” => true,
    “menu_icon” => “https://bictontravel.wpengine.com/wp-content/uploads/2020/07/Money-Bag_White_3.png”,
    “supports” => [ “title”, “editor”, “thumbnail”, “page-attributes” ],
    ];

    register_post_type( “specials”, $args );
    }

    add_action( ‘init’, ‘cptui_register_my_cpts_specials’ );

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just to be certain, do you have more than 1 post drafted/published? It’s not going to show the dropdown till you have at least 2 to work with.

    Thread Starter davidbicton

    (@davidbicton)

    Yea there are over 50 posts

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Is any of the “page attributes” metabox showing? With my testing it was showing the post order input, but that’s it.

    Beyond that, I wasn’t able to recreate an issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to set child on custom post type’ is closed to new replies.