When we use the theme twentyeleven, we want to use our own photos and random header photos, which cannot be achieved through the background submission, so we need to submit and modify the photos ourselves.CodeIt is very simple. Please do not spray it, because I just want to make a record for later use.
Step 1: Prepare the image:
Two formats (one is 1000*288 and the other is 230*66) must be prepared for each image)
Assume that 1000*288 of the image name is rocco.jpg, then 230*66 of the image name is: rocco-thumbnail.jpg
Part 2: Upload to WP-content/themes/twentyeleven/images/headers/
Part 3: modify the code:
Code modification: Wp-content/themes/twentyeleven/functions. php
Modify the function: register_default_headers. Add the following content:
'Rocco' => array ('url' => '% S/images/headers/rocco.jpg ', 'thumbnail _ url' => '% S/images/headers/rocco-thumbnail.jpg',/* Translators: Header Image Description */'description' => _ ('rocco ', 'twentyeleven '))
Note the comma.