Okay
  Public Ticket #3081595
Custom Color on Post Editor
Closed

Comments

  • Lynne started the conversation

    I'm trying to add custom colors to the WYSISYG blog editor so every time a user opens it they have their brand colors available. It appears the recommendation online is to update the functions.php file but I'm very novice and don't want to break the site, lose it on the next update, or really see where to update it. The only option available to me is in the Theme File Editor (screenshot attached) but this seems to be pulling coding from somewhere else, and I'd prefer to do it in a child file but don't how to do that. Can someone provide guidance on a plugin to use or where exactly to add the custom coding? 

    function mytheme_setup_theme_supported_features() { add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'dark blue', 'yourthemename' ), 'slug' => 'dark-blue', 'color' => '#2193b0', ), array( 'name' => __( 'light blue', 'yourthemename' ), 'slug' => 'light-blue', 'color' => '#6dd5ed', ), array( 'name' => __( 'orange', 'yourthemename' ), 'slug' => 'orange', 'color' => '#ff9900', ), array( 'name' => __( 'green', 'yourthemename' ), 'slug' => 'green', 'color' => '#8aa346', ), ) );
    } add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' );


    Attached files:  Editor Screenshot.png
      Screen Shot 2022-07-10 at 10.15.08 AM.png

  •  982
    ThemeNectar replied

    Hey Lynne,

    You can add that snippet to your child theme functions.php. When you install/activate the included child theme (available in the ThemeForest download), you'll see the functions.php file in the file editor for that which will look like the following:

    5220651359.png

    You can insert that custom snippet on line 15, before the ending closing PHP tag.

    Kind regards,