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


Comments

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

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.