Time for action – testing the theme

Let's install our theme in a site and test it. Perform the following steps:

  1. Open a clean WordPress installation.
  2. Go to the Themes screen by clicking on Appearance.
  3. Click on the Install Themes tab.
  4. At the top of the screen, click on Upload as shown in the following screenshot:
    Time for action – testing the theme
  5. Click on the Choose File button and select your ZIP file.
  6. Your file will upload to WordPress. Click on Activate.
  7. Now test the theme, checking that it displays properly in the site and that all of the functions you expect are available. You may have to amend the Permalinks and Reading settings to do this—for a recap on how to do this, see Chapter 4, Advanced Theme Features.

What just happened?

You uploaded your theme to a fresh WordPress installation and tested it. Hopefully, it's all working ok—well done!

Have a go hero – using the WordPress Theme Unit Test

You've already learned about the Theme Review guidelines earlier in this chapter, but if you want to submit your theme to the theme repository, you'll also need to make sure it passes the Theme Unit Test.

As part of the theme review, the Theme Review Team will run tests on your theme, known as the Theme Unit Test (http://codex.wordpress.org/Theme_Unit_Test). You can do this yourself for your own theme to test it. To do so, you follow a few steps:

  1. Download an XML file from https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml to your theme.
  2. Import some text data by navigating to Tools | Import.
  3. In the wp-config.php file in your WordPress installation, set WP_DEBUG to true, using the instructions at http://codex.wordpress.org/WP_DEBUG.
  4. Install some specific plugins and follow the testing process. You can find the full instructions at http://make.wordpress.org/themes/about/how-to-join-wptrt/.

Try doing this for your theme—it helps to know if your theme will pass before you submit it, and is a useful way to learn about the standards required for themes listed on the WordPress website.

Pop Quiz - questions on packaging up your theme

Q1. What license should a WordPress theme have to be accepted to the theme repository?

  1. GPL
  2. Creative Commons
  3. Split license

Q2. Where do you place information that will be displayed in your theme's listing on the Themes admin screen?

  1. In functions.php
  2. In the <head> tag of header.php
  3. In a separate file of its own
  4. In style.css

Q3. What type of file should you upload to the WordPress theme submission page?

  1. A PHP file
  2. A ZIP file
  3. A README.TXT file

Q4. What is the Theme Unit Test?

  1. Specifications for the files your theme should include
  2. A list of template tags your theme has to use
  3. Guidelines on theme templates
  4. A process for testing if your theme meets the Theme Review guidelines
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset