### Still within the functions.php file, add the following array below the ones you've already created in the tutorial.

This will create a new sliding options panel similar to the ones you created in the tutorial. It's a long bit of code, but it follows the same exact logic as the tutorial. We are simply creating variables for all of the different settings that we'll need to define in the Piecemaker's XML file. An important thing to note is that we made sure to define default values for each option (the values in 'std' are the default values). There are a decent amount of settings for the Piecemaker and we don't want to force our users to set up all those options if they don't want to.

## Step 6. Update Our Page Template

In this step, we need to slightly modify our WordPress page template from Step three. Instead of pointing our xmlSource to an XML file, we need to point it to a PHP file. By using a PHP file instead of an XML file, we can pull in all of the values that were set by the user in our custom options panel. It's just the one line of code that needs to be replaced:

## Step 7. Generate our XML File with PHP

We're almost there! In this step, we'll create the PHP file that we just referenced in the code above. This PHP file will be used to pull in all of the values from our custom options panel and generate the XML file that the Piecemaker needs in order to function properly. The code is somewhat lengthy, so I'll try to break it up into more digestable chunks.

Create a blank PHP file, name it "piecemakerXML.php", and paste the following code at the start of the file:

• The first line loads WordPress into our PHP file. This allows us to have access to all of the default WordPress functions, as well as any values stored within our database.
• The rest of the code pulls in the data from our custom options panel and stores those values into variables. We will use these variables to generate the rest of the Piecemaker's settings.
• Next, we need to set the content-type header so that the browser knows we are going to output XML content rather than the default text/html. We will also include some initial Piecemaker settings tags.

We are now going to output the variables we stored into their correct XML tags, and close out the Piecemaker settings tag.

The final step is to output the images that we want to include in the rotator along with their descriptions, and we'll also close out the Piecemaker XML tag.

## Conclusion

I hope you learned something useful in this tutorial. By combining various different technologies, we're able to add powerful functionality to our WordPress themes. More importantly, we made it easy for the average user to make customizations to our theme.