How can I use page.php?
-
Hi, thanks for the nice plugin.
I am having trouble with single.php being applied.I have turned on the “Page Attributes” in the “Support” section of the settings page.
However, the template “single.php” is applied.
(Checked with plugin QueryMonitor)I would like to use page.php.
What settings do I need to change?function cptui_register_my_cpts_contents() { /** * Post Type: MyContent. */ $labels = [ "name" => __( "MyContents", "astra" ), "singular_name" => __( "MyContent", "astra" ), ]; $args = [ "label" => __( "MyContent", "astra" ), "labels" => $labels, "description" => "For Members", "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" => false, "delete_with_user" => false, "exclude_from_search" => true, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => [ "slug" => "contents", "with_front" => true ], "query_var" => true, "supports" => [ "title", "editor", "thumbnail", "page-attributes" ], "show_in_graphql" => false, ]; register_post_type( "contents", $args ); } add_action( 'init', 'cptui_register_my_cpts_contents' );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘How can I use page.php?’ is closed to new replies.