Discard the tedious option page and add option setting files to the WordPress topic

Source: Internet
Author: User
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.

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.