Support

Account

Home Forums General Issues Setting Field group wrapper/metabox colours

Helping

Setting Field group wrapper/metabox colours

  • Is it possible to set colours of the wrapper/metabox of an individual field group so that the user can easily distinguish between groups while editing the page?

  • Hi @cocomitte

    Thanks for the post.

    It is possible to enqueue some custom styles for the acf admin panel through the use of the acf/admin/enqueue_admin_scripts action like so:

    function my_acf_admin_enqueue_scripts() {
    	
    	// register style
        wp_register_style( 'my-acf-input-css', get_stylesheet_directory_uri() . '/css/my-acf-input.css', false, '1.0.0' );
        wp_enqueue_style( 'my-acf-input-css' );
        
        
        // register script
        wp_register_script( 'my-acf-input-js', get_stylesheet_directory_uri() . '/js/my-acf-input.js', false, '1.0.0');
        wp_enqueue_script( 'my-acf-input-js' );
        
    }
    
    add_action( 'acf/input/admin_enqueue_scripts', 'my_acf_admin_enqueue_scripts' );

    You would first need to create the custom stylesheet and then call the action in your theme.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.