Site logo

Archived topic

Simple CSS and post types

3 replies · Started by Ash on October 28, 2020

Viewing posts 1–4 of 4

Question about Simple CSS plugin but GeneratePress.
Is there a way to enable Simple CSS metabox on certain post types?
i.e. only on Pages.

There are many post types I don't need Simple CSS metabox.

Hi there,

You could try something like this:

add_action( 'add_meta_boxes', function() {
    $post_types = get_post_types();

    foreach ( $post_types as $post_type ) {
        if ( 'page' !== $post_type ) {
            remove_meta_box( 'simple_css_metabox', $post_type, 'normal' );
        }
    }
}, 20 );

Thank you!

You're welcome :)

This archived topic is closed to new replies.