Code To Add Color Picker To Meta Box On Edit Post Screens

This code creates a color picker meta box which loads on the Edit Post screen.

You can use the color picker to style any element on any single post like you see in the following demo video.

Demo Video

Shows how the color picker meta box can be added to the Edit post admin screen using screen options and used to style any element on any single post.

Tested using the Genesis Sample child theme by StudioPress however will work in any WordPress or Genesis child theme.

Code Installation

There’s only 1 step. Copy & paste the PHP code from the functions file in the download folder to the end of your child themes functions.php file and check the screen options to show the meta box on Edit Post screens.

Register or login to access the code in the download folder :

Related Code Snippets

2 responses to “Code To Add Color Picker To Meta Box On Edit Post Screens”

  1. Steven Brettler Avatar
    Steven Brettler

    Could this be modified to also work on pages?

    Thanks

    1. Hello Steven. Modify the 4th parameter for the add_meta_box function $screen. See here where the code in functions from the download folder is modified between lines 34 – 45

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.