A large number of exquisite WordPress themes and unlimited plug-in extensions promote the extensive use of WordPress. They are also very fond of WordPress kids shoes for integrating background options, because they can quickly and conveniently set themes, improve efficiency. Adding background options for custom WordPress themes is a good choice for customer friendliness and convenience.
However, adding a background option consumes a lot of work and is quite painful for topic developers. For custom WordPress themes, there are not many options to be configured, and the customer does not know how to modify the theme. In the end, they can help the customer modify the theme. Therefore, in this regard, this article provides a compromise and extremely simple solution: add an option configuration file for the WordPress topic to save frequently used global configuration variables in the topic folder, then, use these global variables in the topic file. you only need to modify the global configuration variables.
The following is an example of how to set LOGO image parameters for a topic:
1. add a config. php file in the WordPress topic directory. the content is as follows: (add the global parameter LOGO_URL)
Define ('logo _ url', 'Here is the LOGO image address'); // the logo image address
Note: The code must be in Inside
2. add the following code in functions. php:
// Loads custom settings from config file
Function load_config (){
$ Config_file = TEMPLATEPATH. '/config. php ';
Require_once ($ config_file );
}
Add_Action ('init ', 'load _ config ');
Note: The code must be in Inside
3. assume the logo in header. php of the topic
">
Change:
">"/>
In this way, a parameter LOGO_URL is defined to set the logo image address. you can refer to the following example.
I have already discussed how to add option setting files for the WordPress topic. However, from the perspective of conversion, I think this solution is of little significance from the perspective of a topic developer, because most customers do not have any technical background, this solution undoubtedly makes it more difficult for customers to use WordPress. Therefore, even if the background option is added to the topic, it is the only choice that even mi studio provides the best service for every customer.