Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Andrew Folts
Andrew Folts
14,238 Points

Can you style Custom Fields in the Wordpress page editor?

Advanced Custom Fields just adds fields in a list to a Wordpress page editor. But is there a way to add a few styles to the page editor admin area?

For example, it would be nice if I could increase the margin between Field Groups, so it's more readable and organized for clients editing content—and doesn't just look like a long list.

1 Answer

Alexandre Babeanu
Alexandre Babeanu
10,946 Points

I've actually never tried this but it seems you can hook your own css styles for the backend in functions.php

      //function to enqueue stylesheet
      function admin_css() {

          $admin_handle = 'admin_css';
          $admin_stylesheet = get_template_directory_uri() . '/css/admin.css';

          wp_enqueue_style( $admin_handle, $admin_stylesheet );
      }

     // hook to add stylesheet
     add_action('admin_print_styles', 'admin_css', 11 );

then just add your styleheet in your them folder's css directory.

cheers

Alex