Check if admin is editing page or custom post type

is_page() is not working on the admin area so I needed to use the following code function this_screen() { $current_screen = get_current_screen(); if( $current_screen ->id === “page” ) { include_once ‘page_admin.php’; } } add_action( ‘current_screen’, ‘this_screen’ ); You can replace “page” to any custom post type name

how to check if custom post type exists in wordpress

you can do it with Function post_type_exists https://codex.wordpress.org/Function_Reference/post_type_exists Examples if ( post_type_exists( ‘book’ ) ) { echo ‘the Book post type exists’; } $exists = post_type_exists( ‘post’ ); // returns true $exists = post_type_exists( ‘page’ ); // returns true $exists = post_type_exists( ‘book’ ); // returns true if book is a registered post type $exists … Read more

Display custom post type taxonomies as an archive page

Your desired URLs: www.example.com/results/post-name/ www.example.com/results/categories/category-name/ Two changes from your original code: Priority was added to both add_action hooks to reverse the order they execute. Order matters in this case, because the post type’s attachment rewrite rules override the taxonomy rewrites. Side-effect: attachment URLs don’t work for this post type! Rewrite for the taxonomy was changed … Read more

How can I change the title of an Add New page in Admin for custom post type

When you’re registering new post type with register_post_type, you can pass labels parameter (which is an array of labels used for that CPT). You can customize these labels: ‘name’ – general name for the post type, usually plural. The same and overridden by $post_type_object->label. Default is Posts/Pages ‘singular_name’ – name for one object of this … Read more