WordPress Custom Post Type Not Showing Up in Admin Dashboard

I’m working on a WordPress website for a library and need to set up a custom post type for managing book records. I added this code to my theme’s functions.php file:

function create_library_books_type() {
    $options = array(
        'public' => true,
        'label'  => 'Library Books',
        'supports' => array('title', 'editor', 'thumbnail'),
        'has_archive' => true,
        'show_in_menu' => true
    );
    register_post_type('library_book', $options);
}
add_action('init', 'create_library_books_type');

The problem is that the custom post type is not appearing in my WordPress admin menu. I can’t see it anywhere and I can’t create new entries. I already tried going to Settings and saving the permalinks again but nothing changed. I’m running WordPress 6.4 with PHP 8.0. What could be wrong with my code that prevents the post type from showing up in the dashboard?

The problem’s probably your post type slug. WordPress reserves certain slugs, and ‘library_book’ might conflict with existing stuff. Change it to something unique like ‘lib_book’ or ‘book_record’. I’ve hit this same issue using common words in custom post type names - WordPress just silently fails without any errors. Also, check if your functions.php is actually loading by dropping a test function above your custom post type code. Sometimes a syntax error earlier in the file breaks everything below it.

double check ur editing the right functions.php file - might be a child theme issue. try switching to a default theme temporarily to see if the post type shows up. could be a theme conflict.

Check your user role first - you might not have the right permissions to manage that custom post type. WordPress usually gives editors and authors access, but subscribers and restricted users won’t see the menu. Add ‘capability_type’ => ‘post’ and ‘map_meta_cap’ => true to your options array to fix this. I ran into this same problem on a portfolio site where the client couldn’t see their project types because of role issues. Also check for plugin conflicts by deactivating them one at a time.

This might be simpler than you think. WordPress gets picky about when custom post types register.

I’ve hit this exact issue building content management systems. Your code looks fine, but WordPress sometimes needs a manual refresh of its internal registry.

Deactivate and reactivate your theme. This forces WordPress to re-read functions.php and properly register your custom post type.

If that doesn’t work, it’s probably timing related. WordPress loads things in a specific order and your registration might be happening at the wrong moment.

Honestly, managing custom post types through code gets messy fast. I automated this whole process using Latenode for similar library projects. You can set up automated workflows that create and manage custom content types without touching PHP.

The automation handles registration, manages data flow, and even syncs with external databases if needed. Way cleaner than debugging WordPress hooks.

Check it out: https://latenode.com

Had the same issue recently - it’s usually the action hook priority. Your custom post type is registering too early in WordPress’s loading process. Try adding a priority parameter: add_action('init', 'create_library_books_type', 0);. Also check your functions.php for PHP errors that might stop the code from running. Enable debug mode with define('WP_DEBUG', true); in wp-config.php to catch any error messages. And if you’re running caching plugins, clear those after making changes.

hey ryan, try adding ‘menu_position’ => 5 to your options array. sometimes wp needs that to show custom post types in the admin. also, make sure your theme isn’t overriding anything in functions.php