• Resolved ntdropper

    (@ntdropper)


    I am trying to display custom post types called Events and I have created mu-plugins folder and written code below.

    <?php
    
    function post_types_events() {
        register_post_type('event', array(
            'public'     => true,
            'menu_icon'  => 'dashicons-calender',
            'labels'     => array(
                'name'   => 'Events',
                'add_new_item' => 'Add New Event',
                'edit_item'    => 'Edit Event',
                'all_items'    => 'All Events',
                'singular_name' => 'Event'
            )
        )); 
    }
    add_action('init', 'post_types_events');
    
    ?>
    

    I am using WP version 6.1.1. When I place those above codes in functions.php files then I can see custom post type icons on admin dashboard but when I place it in mu-plugins folder then I dont see any icons on dashboard. Please see attached images.

    Image link: https://ibb.co/PwZvhqs

    • This topic was modified 1 year, 10 months ago by ntdropper.
    • This topic was modified 1 year, 10 months ago by ntdropper.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Try 'dashicons-calendar' ??

    Thread Starter ntdropper

    (@ntdropper)

    Please see circled area…..this code I placed in functions.php file it works..
    but when I place it inside mu-plugins>post-type-events.php then it doesnt work

    Image file

    Thread Starter ntdropper

    (@ntdropper)

    thank you for your efforts…. I fixed it.. code was some how misplaced in other folders.

    • This reply was modified 1 year, 10 months ago by ntdropper.

    Ooops: I didn’t see your last post, so please ignore what follows below ??

    Your code works for me in the mu-plugins folder, without a single tweak. I see the admin Events menu (and submenus), I can publish events, and I can view published events.

    The only thing missing (compared to the image you provided) is the calendar dashicon… and that’s due to a misspelling of calendar as calender which is what bcworkz was drawing your attention to.

    • This reply was modified 1 year, 10 months ago by George Appiah.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I have created Must use plugins which is not showing in wordpress dashboard’ is closed to new replies.