In WordPress 3.0, users can upload their favorite pictures as the theme background. So how does WordPress change the theme background? The following are specific steps.
1. Add the following function to the theme’s functions.php file (if there is no such file, create one yourself):
1add_custom_background();
2. Upload the background image
After completing the previous step and adding the custom background function support code to your theme, open the WordPress control panel and a [Background] menu option will appear under the [Appearance] column. Click it. The following setting options page will appear:
As you can see from the picture above, if you have not uploaded a picture, there is only a background color selector in the [Display Options] column, but if you After uploading the picture, it will become as shown below:
The settings are quite simple. There are three more setting options in [Display Options] than before the picture was uploaded: background, repeat and attachment method, but we can still set the background color at this time.
For more wordpress related technical articles, please visit the wordpress tutorial column to learn!
The above is the detailed content of How to change wordpress theme images. For more information, please follow other related articles on the PHP Chinese website!