When building a custom theme,it's important to test it against all the different typesof content people can place on that WordPress sitethe theme we're running on.Now, depending on the type of site you're building,you will need to build custom content that mimicswhat will actually go on the site.But regardless of what you are building,you need to test for all the basics, such as content types,HTML tags, image alignments, and so on.Now, building all that test contentcan take a really long time,but fortunately you don't actually have to do it.You can simply download what's known asthe Theme Unit Test data for WordPress.
This is a full set of content for a WordPress sitethat covers all the bases and providesall the weird scenarios you need to test for.The Theme Unit Test data can be foundat the WordPress.org Codex.Here you see you have page that explains how to install it,and I'll walk you through the process.The first step is to downloadthe actual Theme Unit Test data.It's found in an XML filethat you can download straight from here.
So I'll just right-click on it, save link as,and just save it under my Downloads folder.Then, can go to your WordPress site,go to the back-end, go to "Tools," and "Import,"and from here, select "WordPress."If you haven't used the WordPress Importer before,you'll have to install it.
It's an external plugin you can install inside WordPressand you go to that plugin installer automaticallywhen you click on WordPress.So from here I'll click "Install Now."The plugin is downloaded, unpacked and installed,and now I can activate the pluginand run the importer at the same time.So I'll click on that,and you'll notice this will produce the same actionas if I went to "Tools," "Import," and "WordPress."From here, I can now choose the file I just downloaded.So I'll select "Choose File," go to "Downloads,"find "theme-unit-test-data," and click "Open,"and then click "Upload file and import."Now the file is uploaded into my WordPress installationand WordPress has some more questions for me.
First, it wants to know if I want to importthe existing authors that are containedwithin this imported file.So here you see we have one, two, three and four authors.You can choose to just import them the way they are,or you can create a new user and login namefor each of these authors,or you can assign each of the author contentto a specific user.But I'm just going to leave it the way it is.Next, and importantly, you get theImport Attachments option.You need to check this boxto download and import the file attachments,otherwise you will have a bunch of empty boxeswhere images should be but aren't.
So if you check this box, WordPress will go out on the web,grab all this content, and pull it into your siteso you get all the images and other media elements.Once you've checked this box, click on "Submit."Now WordPress will run through the entire XML fileand import all the content includingpulling down content from the web.This will take a little while,and while the process is runningyou'll just see this white screen.The only thing you have to remember here isdon't click the back button,because if you click the back button you stop the process.So just let this process run.
And when it's done, you get this message."Import WordPress"All done. Have fun!"So check out what happened now.If I go to the front-end of my site again,I now have a ton of content.You can see here at the topI have a gigantic menu with lots of dropdowns,here I have a bunch of postswith lots of different types of content in it,and if I go to the back-end and go to "Posts,"you'll see we have a long list of actual posts.We have a scheduled post, a draft post,a markup post that shows all the different HTML tagsand formatting you can add to a post.
We have an image alignment post,a text alignment post,a title with special characters post,and so on and so on.And this is the point of the Theme Unit Test data.It provides you with all the types of postsand pages you can create,and within those posts and pages you will haveall the different types of content you can create.So, we have a post that shows all the different typesof image alignment you can do.Here we have a center aligned image,a left aligned image, a very large image,a right aligned image,a center aligned image with a caption, and so on.
You also have other types of postslike a password protected post,and a comments disabled post,and a template with comments.This one in particular, if you go and view it,you'll see it has 19 comments.In these comments, you again haveall the different types of HTMLthe users can insert into your comments.So using the Theme Unit Test data in your siteallows you to see what types of contentmay end up on the site, and ensure thatyou are styling and formatting everything properly.As we progress through the course,I encourage you to go check outall the different types of content you've downloadedwith the Theme Unit Test data,find out what each of the posts and pages and menus containand make sure you understand itso that as we progress through the courseyou'll be able to compare what you're doingto actual content and make sure that every piece of contentworks the way it's intended to.