你如何设置ACF(高级自定义字段)Wordpress插件的管理/后端的样式?

Jes*_*ips 1 css wordpress-theming advanced-custom-fields

当您有很多选项时,ACF后端/管理面板会变得非常混乱.我看到你可以在哪里更改宽度百分比并将自己的类添加到自定义字段中,但是如何设置这些类的样式?只是将这些类名添加到style.css不起作用!

Jes*_*ips 7

您必须将此代码添加到functions.php文件中.这是一些文档.

function my_acf_admin_head() {
    ?>
    <style type="text/css">

    /* css here */

    </style>
    <?php
}

add_action('acf/input/admin_head', 'my_acf_admin_head');
Run Code Online (Sandbox Code Playgroud)

这是我使用的代码.它使ACF管理员看起来更好:

function my_acf_admin_head() {
?>
<style type="text/css">

    .acf-flexible-content .layout .acf-fc-layout-handle {
        /*background-color: #00B8E4;*/
        background-color: #202428;
        color: #eee;
    }

    .acf-repeater.-row > table > tbody > tr > td,
    .acf-repeater.-block > table > tbody > tr > td {
        border-top: 2px solid #202428;
    }

    .acf-repeater .acf-row-handle {
        vertical-align: top !important;
        padding-top: 16px;
    }

    .acf-repeater .acf-row-handle span {
        font-size: 20px;
        font-weight: bold;
        color: #202428;
    }

    .imageUpload img {
        width: 75px;
    }

    .acf-repeater .acf-row-handle .acf-icon.-minus {
        top: 30px;
    }

</style>
<?php
}

add_action('acf/input/admin_head', 'my_acf_admin_head');
Run Code Online (Sandbox Code Playgroud)