Tips for customizing the color scheme of the background management interface in WordPress, wordpress color scheme _ PHP Tutorial

Source: Internet
Author: User
Tips for customizing the color scheme of the background management interface in WordPress: wordpress color scheme. Tips for customizing the color scheme of the background management interface in WordPress. The brand-new background design starting with wordpress color scheme WordPress3.8 supports multi-color selection, by default, there are eight tips for customizing the color scheme of the background management interface in WordPress.

The background of the brand-new design starting with WordPress 3.8 supports multi-color selection. by default, there are eight very exquisite colors that can be selected by users.

The color scheme WordPress provides a function wp_admin_css_color () that allows developers to customize the color scheme. you only need to call this function to complete all registration operations.

Parameters

    wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() );
  • $ Key (string): The color ID.
  • $ Name (string): Color name, displayed in the background
  • $ Url (string): CSS referenced when this color is selected
  • $ Colors (array): The demo color under the name when the user selects a color. you can set unlimited values. we recommend four colors. The default value is an empty array.
  • $ Icons (array): the color of the SVG icon. it can be set to an array with a length of 3. the key values are base, focus, and current. The default value is an empty array.

Example

First, you need to prepare a CSS file, which stores the CSS file called when the user selects your color scheme, that is, the CSS of the color scheme, which can be customized, you can also copy the default color CSS of WordPress to modify it (/wp-admin/css/colors.min.css ).

Then you can register it in the PHP file. let's take a look at an example. In this example, a function is created and mounted to admin_init, and then the color is added.

/***** Create background custom color * export Bing_add_admin_color () {wp_admin_css_color ('Bing ', 'custom', get_bloginfo ('Template _ directory '). '/color_style.css', array ('red', '# aaa',' # FEFEFE ',' #000 '), array ('base' =>' #999 ', 'corout' => '# 2ea2cc', 'current' => '# fff');} add_action ('admin _ init', 'Bing _ add_admin_color ');

Location

Function File:/wp-des/general-template.php

Articles you may be interested in:
  • Implement function parsing for sending http requests in WordPress
  • How to set the default content in the WordPress article editor
  • PHP functions used to create and retrieve sidebar in WordPress
  • How to add and execute actions in WordPress

The background of the brand-new design starting with WordPress 3.8 supports multi-color selection. by default, there are eight very exquisite types...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.