5 Common SEO Questions

One goal for many businesses is to improve their search engine rankings.

Sales are driven by leads, which are driven in part by search, so this goal is understandable.

However, there is a lot of misinformation regarding SEO out there.

Here are five common SEO questions and their answers.

Do Meta Keywords Matter Anymore?

No. Google stopped using meta keywords since at least 2009, and probably several years before that as well. Yahoo also ignores the meta keyword tag. Bing does look at it, but if any keywords in the tag do not appear in your page, your page will be penalized in Bing’s search results.

In the early days of search engines, many people would keyword stuff the keywords meta tag in hopes of boosting their rank. Search engines algorithms became sophisticated to this tactic long ago, and there is absolutely no benefit to using this meta tag anymore.

Do WordPress Tags Help SEO?

Sometimes, but not in the way you might think. Observing how many people use tags, it seems as though they are using them as a substitute for meta keywords. Google does not currently use WordPress tags to determine what a post is about. Tag archive pages and other archive pages can turn up in search results, though it is uncommon for them to rank very high.

Tags and Categories in WordPress are just a way to sort things. Categories should be a generalized subject, tags should be a more finely tuned subset of a category. WordPress uses categories and tags as a means to relate posts to one another. By adding extraneous and unnecessary tags, the relationships between the posts are diluted. Using dozens of tags on a WordPress post will not help that post rank higher in Google for those tag phrases.

Why Did My Site Drop In Google?

That depends on how many spots you dropped. Google readjusts their algorithm several times per year. I have noticed the order of results fluctuates about once a week for most search terms.

If your site has only slipped a few notches, that is not something I would be overly worried about. It is likely that your site will rise again as Google readjusts its algorithm. What I would be concerned about is if your site has dropped several dozen spots or more for a specific keyword search. This could be an indication you are being penalized for a shady SEO practice. Some of the things that Google frown on include selling rel="follow" links , buying links, having overly thin content, keyword stuffing, concealing on page text, having backlinks from questionable websites, or being infected with malware. Sudden drops can also be caused by moving your hosting or robots.txt blocking search bots.

If none of these apply, and you experienced a sizeable, persistent drop in search rank, having your site audited for SEO best practices is a good next step. Here is a video from Google’s Matt Cutts that will also help you diagnose the problem.

Does Google Authorship Help SEO? And What Happened To Google Authorship Avatars?

Yes, and they are still there — in certain cases. Google+ started in 2011, and currently has about 640 million active users, about 2.5 times as large as Twitter. One of the incentives that led businesses to use Google+ was a metric called AuthorRank. Authors would verify their identity and link their Google+ to their published works online. Google would then measure an author’s authority on certain subjects over time and give them a small boost in the search rankings. This would mainly affect high authority authors, and come into play when comparing more in-depth articles. This data has been confirmed as still being used in some fashion.

Part of the appeal of Google Authorship was the author avatars that accompanied a search result. These added visual appeal an increased click-through rate. At the beginning of 2014, the frequency with which these would appear started decreasing. In June of 2014, Google announced that the avatar photos would be abandoned in favor of an author byline. Google says they intend to be a mobile-first company, and the photos took up extra screen space on mobile devices.

But did the photos disappear altogether? It turns out that they didn’t entirely. When you are logged into Google and have personal search results turned on, you will still see author avatar son Google+ results for people in your circles. For now, this is the only place where these still occur. Google is not abandoning the Authorship program, and will still collect data to figure out who authoritative writers are in each category.

Google Authorship Still Shows Up For Google Plus

Update (August 28th, 2014): Google officially confirmed today that articles will no show Authorship avatars, but relevant results from your Google+ network will still be shown when you are logged in.

I Just Did Some SEO Work On My Site — How Long Before Google Ranks My Site On The First Page?

That depends. How competitive is the keyword phrase you’re trying to rank for? Figuring out how to make a page move up in the search rankings depends on several factors, including how many other people are trying to do the same.

Generalized keywords like “cars”, “insurance” or “real estate” are insanely hard to get to the first page of Google. Thee terms are overly broad. A better strategy is to use long-tail keywords which are longer and more specific phrases. Examples of these would be “new car sales in Sacramento–, “life insurance for people over 50” and “Granite Bay real estate over 1 acre”. The more specific the search phrase, the lower the competition, and the hotter the potential lead.

Web pages are usually indexed by Google within a few days. If you have a Google Webmaster Tools account with a sitemap submitted to Google, pages can appear in search results more quickly.

Moving a page up over time relies on off-page SEO. These factors can include what sites link to that page, the link text used to link to the page, the site authority or AuthorRank, how many people click the search result, do people search for that term again after visiting the page. On-page SEO also matters greatly. Improving the speed of the site, optimizing the title tag and meta description, and optimizing the page text and images can all help boost a page.

When FTP Uploads Are Not Visible in WP Media Library

UPDATE March 23rd, 2018: Add From Server was closed as a plugin on the WordPress repo as of earlier today. No details yet on whether this was an action by the plugin author or the Plugin Review team.

UPDATE March 28th, 2018 The plugin author had the plugin removed temporarily and stated the following:

“Plugin was closed at my request as I got sick of the constant stream of complaints about it not working and reviews to that direction.

If you had the plugin automatically removed from your site, please complain to whomever did that, as that’s a step too far.

The plugin will be re-opened at a future time when I’ve had a chance to add the “THIS IS COMPLETELY UNSUPPORTED CODE FROM 8 YEARS AGO BUT STILL WORKS” warnings.

(Edit: re-opened, I’ll update warnings later)”

– Dion Hulse


UPDATE March 29th, 2018
According to the plugin author of Add From Server, the plugin is not actively supported, but the code works. Use it at your own risk.

If you are looking for alternatives, a newer plugin by another developer, Media From FTP, might be worth checking out, as it appears to work in a similar fashion.


Though this is not a common problem, there are times in WordPress when you may have to upload images via FTP to the server. This might occur during a migration from a server that is out of date or underpowered, where moving the Uploads folder via a plugin does not work as smoothly as expected. But uploading images directly to the target server through FTP produces another intriguing problem. The WordPress Media Library cannot “see” images that are not uploaded through the Media Library uploader, and therefore cannot be selected for use as Featured Images or in future Posts.

The Add From Server plugin imports your FTP uploads into the WP Media Library, and allows you to use them as you would normally.

Continue reading “When FTP Uploads Are Not Visible in WP Media Library”

Lessons from Canlis for the Web Industry

The other day I heard a podcast interview that blew me away. In this episode, Chase Reeves interviews Mark Canlis, co-owner of Seattle’s destination restaurant, Canlis.

The restaurant has been operating at an extremely high level of quality and service for over 60 years. Do yourself a favor, go listen to the podcast right now. Once you’ve done that, I’d like to share my own takeaways.


Here’s some thoughts that were running through my head after listening to this interview.

People are the Purpose of Any Business

Business revolves around people. We can convince ourselves that it’s 100% about what we’re trying to sell, but that’s just what gets you to the marketplace — everyone else shows up with that, too. The table stakes for being a business aren’t a strategy that’s interesting or very deep.

I noticed that the people they choose to bring in as employees are usually undergoing a transformation themselves. Their prospective employees talk about who they want to become, and not just what they want to become. These individuals tend to be more finely tuned towards serving others.

“Tonight really needs to matter.”

Mark Canlis said this a few times, referring to their customers. He said, for most people, this was an experience they had been looking forward to for their entire lives. When you come to a restaurant of that caliber, there’s almost always a very special event driving you to do that. These events are things that can never be replicated again. This leaves people in a vulnerable state — they come seeking acceptance, knowing that this is a special occasion, this is a fancy restaurant, and they are not normally people who can go there on a whim.

They come seeking acceptance. The guests do not know how the staff will react to their presence. To their surprise, they are welcomed in a manner that shows them the staff has been waiting for them — that they are not just being accepted, but their arrival has been anticipated. This attitude seems subtle, but it is not. It makes all the difference in the world.

Hospitality Means Making People Feel Safe

Mark also talked about the origins of the word “hospitality”, and the meanings that it held in various cultures. In olden times, it meant that you took in strangers and protected them from harm — that you kept them safe. Likewise, the Canlis family seeks to make their restaurant a safe haven for people to be vulnerable and feel protected emotionally, as these dinners are meaningful.

The staff must be able to read people, and meet them where they are at. Guests are not expected to learn the culture of the restaurant before entering. That would be the opposite of making them feel safe.

All business is about one person connecting to another. Relationships run on trust the way our economy runs on dollars. This is why being trustworthy is so valuable in all aspects of human interaction.

How the Service at Canlis Relates to the Web Industry

There seem to be two general types of company culture in the web industry. Inside the web community, many perceive these differing cultures as being the same thing, because the technology is the same. From my view, these two cultures are as opposite as can be.

There is one sort of culture where the emphasis is on technology over people, success measured mostly in profits and seldom in lives changed. This is the culture many of us idolize, believing it to be omnipresent, but it is only a portion of our industry. A technology-first culture is very different from a people-first culture. Many of us feel most empowered connecting to people at a one-to-one level, knowing the people we are helping on a personal level.

Serving clients requires a deep compassion and empathy for people. Those who lack the ability to listen to, communicate with and understand people usually leave client services to work for larger, product-based companies. As impressive a skill as programming is, being able to listen to and read people is also difficult to learn. In every way I can think of, people skills are more important to a person’s long-term success and happiness.

Focusing on people first and foremost isn’t something that can be acclimated into a company culture overnight. This has to be something that seeps through every pore of a business, from the top down. It has to be genuine and done for the right reasons. Those reasons must be powerful, or we will falter when the fires of attrition test us.

Personal Resonance

I’ve had the good fortune to have lived a somewhat diverse life. From 1988 to 1991, I worked in various restaurants. Then from 1991 to 2008, I worked in retail bakeries. I even worked in a busy Starbucks from 1998 to 2000. The concepts that Mark Canlis talked about in the interview resonated with me, because I understood them from the very place he was speaking from. People go to a five-star restaurant for the same basic reasons they stand in line at a Starbucks, or order a cake to celebrate a special occasion. Customers do not come simply for the food and drink. They come for how the experience makes them feel.

Going out to dinner at Canlis is something that most of their guests look forward to for many years. Likewise, many clients that need a website will not have a chance to do it again for many years. Not only must we get the technology part right, but we must also make our clients feel safe and secure throughout the the entire experience.

How Do We Make Our Clients Feel Safe?

Our clients come to us with varying degrees of tech-savviness. Perhaps they had an unsatisfying experience with another web developer. More often than not, they are fearful of dropping huge sums of cash for something they are trusting us to build, without knowing what the end product will look like yet. That’s a lot of trust for a new client to place in a virtual stranger.

As web professionals, we can be oblivious to how our terminology sounds to clients. Jargon is a barrier that keeps people out. When we don’t comprehend what someone is saying to us, it makes us anxious and nervous. We have to meet clients where they are at, and not require them to learn everything about our field in order to work with us.

If we must explain a concept, we must do so in a way that each client understands. Like the staff at Canlis, we must prepare a place for clients before they arrive. We must learn about our clients and tailor our technical explanations in a way that is unimposing and not intimidating. Communication, not technology, is our greatest tool.

It is imperative to have open communication at the onset of the project, throughout the project, and even at the conclusion of the project. Understanding the goals, objectives, motivations, and fears of the client before a project ever gets underway is critical. Building trust is something that has to worked at anew with each client. Listen, and then listen some more. Read their body language. Hear what they are saying and what they are not saying. Clients are trusting us to protect them and guide them safely through the process building a website.

Another thing that really struck me is a line from the video above.

“This is a business about people. And if it’s a business about people, that means this is a business about relationships.” – Mark Canlis

Too often in the web industry, we believe that what we do is only about technology. The technology is just a tool. What we really build is trust and relationships, the same as any other business. We build trust with clients, and in turn, that helps them build trust with their customers. Our goal should be to minimize risk, lower anxiousness, and ensure success for our clients and their customers.

What Did You Think?

If you listened to the Mark Canlis interview on Fizzle.co, I’d love to hear your take on it. Let me know what your takeaways were in the comments below.

Build A Quiz In PHP: What Metal Band Are You?

In 2013-2014, I had a series of client projects where I needed to build a quiz in PHP.

Taking what I learned from that, I designed a quiz of my own, where you answer multiple choice questions and determine what heavy metal band your personality resembles.

The subject matter can be changed to whatever your own needs are. The focus of this tutorial is to show how to build this particular quiz and explain how the logic works.

First, let me show you the finished quiz. Go ahead — try it out.

The Concept

This quiz consists of three PHP rendered pages: an intro screen, the quiz page, and a page that tallies the score and serves up the appropriate result. We will call these three files index, test, and grade. We actually only need the Test and Grade files — the Index file is just there to tell people what the quiz is.

This quiz was built to be embedded. The client projects I built from this original concept were also modified further to be responsive. (Thanks to some special developer magic on the destination site.) These “quizzes” were special ad placements for three well-known global brands that appeared on EW.com.

The Test page only shows one question screen at a time, but the real height of the page is greater than what is visible. You can make the Test page a single visible page with all the questions visible with a few small adjustments.

The basic idea is there are four possible outcomes. Each of these outcomes has a “scorecard” that starts at zero and clicking certain answers will add points to certain scorecards. When we get to the Grade screen, the scores are compared, and the outcome with the highest point total is shown. A call to action button asking users if they to play again links back to the Test screen, where the process starts over.

Implementing the Code

Let’s build the index.php file first. Here we have a simple form that collects answers, and when the Submit button is clicked, takes you to the test.php screen. The whole quiz screen is 600 by 450 pixels. There is a CSS folder and Images folder in the same folder as the PHP files.

The body is relatively positioned to stay centered, and many of the quiz elements are absolutely positioned. Your own variations on this may vary, so feel free to experiment.



<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>What Metal Band Are You? Quiz</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic' rel='stylesheet' type='text/css'>
</head>
<body>
    <div id="page-wrap">
        <form id="start-quiz" method="post" action="test.php">
            <div class="overlay index">
            <div class="quiz-overlay"></div>
	        <h1 class="index-headline">What Metal Band Are You?</h1>
		<p class="index-sell">This personality quiz will reveal which iconic metal band you resemble most.</p>
                <input type="submit" id="submit" class="take-quiz-btn index-btn" value="Take The Quiz" />
            </div>                       
        </form>
    </div>	     
</body>
</html>


/* CSS Part One */
* { 
  margin: 0; 
  padding: 0; 
}
html {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0 auto;
  width: 600px;
}
body { 
  background: #020305 url('../imgs/bg-texture.jpg') center center no-repeat;
  color: #fff; 
  font-family: 'Droid Serif', Times, serif; 
  font-size: 14px;
  max-width: 600px;
}
#page-wrap { 
  height: 450px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  width: 600px;
}
h1 { 
  letter-spacing: 3px;
  margin: 25px 0; 
  text-transform: uppercase;
}
.index-sell, .index-headline {
  color: #1c2d37;
  left: 100px;
  margin: 0;
  position: absolute;
  text-align: center;
  width: 400px;
}
.index-headline {
  font-size: 36px;
  height: 0;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px #fff;
  top: 55px;
}
.index-sell {
  font-size: 21px;
  line-height: 28px;
  text-transform: uppercase;
}
.index-sell { top: 155px; }
.transparent {
  color: transparent;
  display: none;
  opacity: 0;
  visibility: hidden;
}
.take-quiz-btn, .embed-btn, .close-btn {
  -webkit-appearance: none;
  border: none;
  background: #28505e;
  color: #f3f4ef;
  cursor: pointer;
  font-family: 'Droid Serif', Times, serif;
}
.take-quiz-btn, .close-btn {
  background: #28505e;
  font-size: 21px;
  text-shadow: 1px 1px rgba(66,66,66,.666);
  text-transform: uppercase;
}
.take-quiz-btn {
  top: 267px; 
  width: 259px;
}
.index-btn {
  height: 49px;
  left: 168px;
  padding: 9px 0 6px 0;
  position: absolute;
  top: 267px; 
}
.quiz-overlay, .result {
  height: 325px;
  position: absolute;
  width: 552px;
  z-index: -1;
}
.index .quiz-overlay, .quiz-overlay { 
  background: rgba(226,255,246,.52) url(../imgs/horns-up.png); 
  background-size: cover;
}
.index .quiz-overlay {
  left: 24px;
}

The Test Questions

Now the test.php file is loaded. Here, the test questions are wrapped in a form tag and the answers will be recorded for the grade.php file, then evaluated, and an outcome determined.

Each question is the height of the visible screen. When an answer (or any element with the .fwrd class) is clicked on, a jQuery script moves the screen height up to display the next question. Each of the answers are radio buttons, meaning there can only be one answer accepted for each question input. The labels for each radio button lay on top of the buttons themselves, and have the illusion of being clickable links or buttons. These form labels can be styled in any manner you wish with CSS.


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>What Metal Band Are You? Quiz</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic' rel='stylesheet' type='text/css'>
</head>
<body>
    <div id="page-wrap">
        <h1 class="transparent index-headline">Lockedown SEO: What Metal Band Are You?</h1>
	<form action="grade.php" method="post" id="quiz">
            <ul id="test-questions">
                <li>
                    <div class="quiz-overlay"></div>
                    <h3>What do you enjoy watching on TV?</h3>
                    <div class="mtm">
                        <input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" />
                        <label for="question-1-answers-A" class="fwrd labela">a.  Science Fiction movies</label>
                    </div>
                    <div>
                        <input type="radio" name="question-1-answers" id="question-1-answers-B" value="B" />
                        <label for="question-1-answers-B" class="fwrd labelb">b.  CNN and MSNBC</label>
                    </div>
                    <div>
                        <input type="radio" name="question-1-answers" id="question-1-answers-C" value="C" />
                        <label for="question-1-answers-C" class="fwrd labelc">c.  History Channel</label>
                    </div>
                    <div>
                        <input type="radio" name="question-1-answers" id="question-1-answers-D" value="D" />
                        <label for="question-1-answers-D" class="fwrd labeld">d.  Fantasy movies, like <em>Lord of the Rings</em></label>
                    </div>
                    <p class="quiz-progress">1 of 5</p>
                </li>
                <li>
                    <div class="quiz-overlay"></div>
                    <h3>What’s your preferred method of travel?</h3>
                    <div class="mtm">
                        <input type="radio" name="question-2-answers" id="question-2-answers-A" value="A" />
                        <label for="question-2-answers-A" class="fwrd labela">a.  Riding a Harley Davidson</label>
                    </div>
                    <div>
                        <input type="radio" name="question-2-answers" id="question-2-answers-B" value="B" />
                        <label for="question-2-answers-B" class="fwrd labelb">b.  Offroading in a 4 by 4</label>
                    </div>
                    <div>
                        <input type="radio" name="question-2-answers" id="question-2-answers-C" value="C" />
                        <label for="question-2-answers-C" class="fwrd labelc">c.  Piloting my own plane</label>
                    </div>
                    <div>
                        <input type="radio" name="question-2-answers" id="question-2-answers-D" value="D" />
                        <label for="question-2-answers-D" class="fwrd labeld">d.  Riding a horse across the countryside</label>
                    </div>
                    <p class="quiz-progress">2 of 5</p>
                </li>
                <li>
                    <div class="quiz-overlay"></div>
                    <h3>What’s your favorite piece of clothing that you wear?</h3>
                    <div class="mtm">
                        <input type="radio" name="question-3-answers" id="question-3-answers-A" value="A" />
                        <label for="question-3-answers-A" class="fwrd labela">a.  My leather jacket</label>
                    </div>
                    <div>
                        <input type="radio" name="question-3-answers" id="question-3-answers-B" value="B" />
                        <label for="question-3-answers-B" class="fwrd labelb">b.  A dress shirt or nice pair of jeans</label>
                    </div>
                    <div>
                        <input type="radio" name="question-3-answers" id="question-3-answers-C" value="C" />
                        <label for="question-3-answers-C" class="fwrd labelc">c.  My favorite concert T shirt</label>
                    </div>
                    <div>
                        <input type="radio" name="question-3-answers" id="question-3-answers-D" value="D" />
                        <label for="question-3-answers-D" class="fwrd labeld">d.  Custom handmade clothing by a local artisan</label>
                    </div>
                    <p class="quiz-progress">3 of 5</p>
                </li>
                <li>
                    <div class="quiz-overlay"></div>
                    <h3>Out of these, what is your favorite type of music?</h3>
                    <div class="mtm">
                        <input type="radio" name="question-4-answers" id="question-4-answers-A" value="A" />
                        <label for="question-4-answers-A" class="fwrd labela">a.  Softer rock, like Fleetwood Mac or folk music</label>
                    </div>
                    <div>
                        <input type="radio" name="question-4-answers" id="question-4-answers-B" value="B" />
                        <label for="question-4-answers-B" class="fwrd labelb">b.  Punk rock, like the Sex Pistols</label>
                    </div>
                    <div>
                        <input type="radio" name="question-4-answers" id="question-4-answers-C" value="C" />
                        <label for="question-4-answers-C" class="fwrd labelc">c.  70s hard rock and arena rock</label>
                    </div>
                    <div>
                        <input type="radio" name="question-4-answers" id="question-4-answers-D" value="D" />
                        <label for="question-4-answers-D" class="fwrd labeld">d.  Classical music from the masters</label>
                    </div>
                    <p class="quiz-progress">4 of 5</p>
                </li>
                <li>
                    <div class="quiz-overlay"></div>
                    <h3>If you could meet anyone from history, who would you choose?</h3>
                    <div class="mtm">
                        <input type="radio" name="question-5-answers" id="question-5-answers-A" value="A" />
                        <label for="question-5-answers-A" class="fwrd labela">a.  Someone mythic, like Nostradamus or Rasputin</label>
                    </div>
                    <div>
                        <input type="radio" name="question-5-answers" id="question-5-answers-B" value="B" />
                        <label for="question-5-answers-B" class="fwrd labelb">b.  A famous writer, like John Steinbeck</label>
                    </div>
                    <div>
                        <input type="radio" name="question-5-answers" id="question-5-answers-C" value="C" />
                        <label for="question-5-answers-C" class="fwrd labelc">c.  A famous conquerer, like Alexander the Great</label>
                    </div>
                    <div>
                        <input type="radio" name="question-5-answers" id="question-5-answers-D" value="D" />
                        <label for="question-5-answers-D" class="fwrd labeld">d.  One of the Egyptian Pharaoahs</label>
                    </div>
                    <p class="quiz-progress">5 of 5</p>
                </li>
                <li>
                    <div class="quiz-overlay"></div>
                    <h3 class="anticipate">Now it’s time to see your results...</h3>
                    <input type="submit" value="Submit Quiz" id="submit-quiz" />
                </li>
            </ul>
	</form>
        <div class="nomargin"></div>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
    <script>
           (function($) {
              var timeout= null;
              var $mt = 0;
              $("#quiz .fwrd").click(function(){
                clearTimeout(timeout);
                timeout = setTimeout(function(){ 
                    $mt = $mt - 430;
                    $("#test-questions").css("margin-top", $mt); 
                }, 333);
              });
           }(jQuery))
    </script>
</body>
</html>


/* CSS Part Two */
#quiz {
  margin: 0 18px;
  padding: 0 0 0 1px;
  position: relative;
  -webkit-transition: all linear .35s;
  -moz-transition: all linear .35s;
  -o-transition: all linear .35s;
  -ms-transition: all linear .35s;
  transition: all linear .35s;
}
#quiz .anticipate {
  color: #1c2d37;
  font-size: 32px;
  line-height: 41px;
  padding: 50px 0 0 0;
  text-shadow: 1px 1px rgba(255,255,255,.666);
}
#start-quiz {
  margin-top: 25px;
}
#quiz ul li div.quiz-overlay { margin: 0; }
#quiz ul {
  list-style-type: none;
  margin-top: 0;
}
#quiz h3 {
  color: #222;
  font-size: 22px; 
  font-weight: 400;
  line-height: 32px; 
  margin: 0 0 1px 0;
  min-height: 64px;  
  padding: 9px 50px 0;
  text-align: center;
}
#quiz ul li {
  height: 335px;
  margin: 25px 0 95px 0;
  max-height: 335px;
  min-height: 335px;
}
#quiz ul li div {
  color: #ebe9e6;
  margin: 10px 0;
  padding: 1px 0;
}
#quiz ul li div.mtm {
  margin-top: 20px;
}
#quiz input {
  opacity: 0;
  vertical-align: middle;
  width: 20px;
}
#quiz label, #quiz input#submit-quiz {
  background-color: #1f4c5b; 
  cursor: pointer;
  display: inline-block;
  z-index: 99;
}
#quiz label {
  height: 31px; 
  font-size: 13px;  
  line-height: 2.55em;  
  margin: 0 30px 0 0;
  max-width: 476px;
  min-width: 476px;
  padding: 2px 0 4px 16px;
  width: 476px;
}
#quiz input#submit-quiz {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #1f4c5b; 
  border: none;
  color: #ebe9e6;
  display: block;
  font-family: 'Droid Serif', Times, serif;
  font-size: 21px;
  height: 74px;
  margin: 43px auto 0;
  opacity: 1;
  width: 250px;
}
#quiz label, #quiz input[type=radio]:checked + label, #quiz input#submit-quiz, #replay, .take-quiz-btn {
  -webkit-transition: all ease .11s;
  -moz-transition: all ease .11s;
  -o-transition: all ease .11s;
  -ms-transition: all ease .11s;
  transition: all ease .11s;
}
#quiz label:hover, #quiz input[type=radio]:checked + label, #quiz input#submit-quiz:hover, #replay:hover, .take-quiz-btn:hover {
  background: #098636; 
  color: #fbfbfb;
}
#quiz .quiz-progress {
  color: #ebe9e6;
  font-size: 14px;
  padding: 7px 30px 5px 0; 
  text-align: right;
  text-shadow: 1px 1px #131313;
}
.nomargin { margin: 0;}

Many of the class names on this page are unused. What is necessary is the name attribute on each radio button. These must be present for the grading portion of the quiz to work.

The Submit Quiz button at the end takes us to the grading file, where the scores are assessed.

Grading The Answers, Choosing An Outcome

Next, we will build the grade.php. We had to think about how the scoring and outcomes would be determined before we build a test.php to gather those scores. Remember each outcome has its own score, which will be stored in the variables $totalA, $totalB, $totalC and $totalD.

There is a second set of variables, the $answer1 through $answer5 variables. These correspond to the answers for each question, which are



<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>What Classic Metal Band Are You? Quiz Results</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic' rel='stylesheet' type='text/css'>
</head>
<body>
    <div id="page-wrap">
        <h1 class="transparent index-headline" >Here’s What Metal Band You Are</h1>
        
        <?php
            $answer1 = $_POST['question-1-answers'];
            $answer2 = $_POST['question-2-answers'];
            $answer3 = $_POST['question-3-answers'];
            $answer4 = $_POST['question-4-answers'];
            $answer5 = $_POST['question-5-answers'];

            $totalA = 0;
            $totalB = 0;
            $totalC = 0;
            $totalD = 0;

            if ($answer1 == "A") { $totalA = $totalA + 1.17; $totalD = $totalD + .06; }
            if ($answer1 == "B") { $totalB = $totalB + 1.15; $totalC = $totalC + .05; }
            if ($answer1 == "C") { $totalC = $totalC + 1.13; $totalA = $totalA + .05; }
            if ($answer1 == "D") { $totalD = $totalD + 1.16; $totalA = $totalA + .07; }

            if ($answer2 == "A") { $totalA = $totalA + 1.23; }
            if ($answer2 == "B") { $totalB = $totalB + 1.15; }
            if ($answer2 == "C") { $totalC = $totalC + 1.13; }
            if ($answer2 == "D") { $totalD = $totalD + 1.16; }

            if ($answer3 == "A") { $totalA = $totalA + 1.17; $totalC = $totalC + .05; }
            if ($answer3 == "B") { $totalB = $totalB + 1.15; $totalC = $totalC + .03; }
            if ($answer3 == "C") { $totalC = $totalC + 1.13; $totalB = $totalB + .07; }
            if ($answer3 == "D") { $totalD = $totalD + 1.16; }

            if ($answer4 == "A") { $totalA = $totalA + 1.17; }
            if ($answer4 == "B") { $totalB = $totalB + 1.15; }
            if ($answer4 == "C") { $totalC = $totalC + 1.13; $totalA = $totalA + .05; $totalB = $totalB + .06; $totalD = $totalD + .07; }
            if ($answer4 == "D") { $totalD = $totalD + 1.16; $totalB = $totalB + .04; $totalA = $totalA + .045; $totalC = $totalC + .034; }

            if ($answer5 == "A") { $totalA = $totalA + 1.17; $totalD = $totalD + .08; }
            if ($answer5 == "B") { $totalB = $totalB + 1.15; }
            if ($answer5 == "C") { $totalC = $totalC + 1.14; $totalA = $totalA + .06; $totalD = $totalD + .08; }
            if ($answer5 == "D") { $totalD = $totalD + 1.16; $totalC = $totalC + .04; }

            ?>

One of the issue you will have to address in any quiz is how to score tie breakers. Since we have five questions on this quiz, we can end up with two outcomes with two votes apiece (Example: 2 “A” answers, 2 “C” answers, 1 “D” answer).

One way to solve this is to weigh all the outcomes slightly different. To clarify, if all of the outcome questions have the same amount of votes, there will be a predetermined pecking order, where one outcome always wins, and one outcome always loses. You could also make one particular question a tie-breaker, weighted heavier than the other questions.

Another way to solve this problem is to select certain questions, add full points for the “most correct” answer, and add small increments to the other scores for that answer. Because many of the questions I wrote related to more than one of the four outcomes, this is what I used for this particular quiz.

The downside to this solution is that you will have to experiment with how to weight the scores for each answer. I found very small fractions work best in this scenario. The more questions your quiz contains, the less feasible this is for a tie-breaker solution. The code above is what I went with for this quiz — you will have to adjust this for your own content.

The Outcomes

Below is the remainder of the grade.php file. For each outcome, the scores are being compared. For Outcome A to win, it must be greater than B, C, and D. If not, it goes to Outcome B, which must be greater than A, C, and D…and so on.

Whichever outcome scores highest is displayed. The HTML is output via an echo statement for each possible outcome.


 <div class="results-overlay">

            <?php
            if ($totalA > $totalB && $totalA > $totalC && $totalA > $totalD) {
                  echo '<div class="quiz-overlay result priest"></div><div class="results-text"><p class="you-chose">You Scored:</p><img src="../imgs/priest.jpg" alt="Judas Priest" class="results-img" /><div class="results test-results2"><p class="score">Judas Priest</p><p class="score-details">Judas Priest brought heavy metal to a new level with the twin guitars of Glen Tipton and KK Downing and vocals of Rob Halford. Songs you should listen to: Sinner, Victim of Changes, The Ripper, Beyond The Realms of Death, Delivering The Goods, Breaking The Law, Solar Angels, The Sentinel, Painkiller, Nightcrawler, Burn In Hell, Hellrider, Judas Rising.</p><a id="replay" class="take-quiz-btn" href="/test.php">Play Again?</a></div>';
            }
            elseif ($totalB > $totalA && $totalB > $totalC && $totalB > $totalD) {
                  echo '<div class="quiz-overlay result megadeth"></div><div class="results-text"><p class="you-chose">You Scored:</p><img src="../imgs/megadeth.jpg" alt="Megadeth" class="results-img" /><div class="results test-results2"><p class="score">Megadeth</p><p class="score-details">After getting tossed from Metallica, guitarist/singer Dave Mustaine formed Megadeth with bassist Dave Ellefson, one of the iconic thrash metal bands. Songs to check out: Peace Sells (But Who’s Buying), In My Darkest Hour, Holy Wars, Hangar 18, Tornado Of Souls, High Speed Dirt, Sweating Bullets, Angry Again, Trust, Kill The King.</p><a id="replay" class="take-quiz-btn" href="/test.php">Play Again?</a></div>';
            }
            elseif ($totalC > $totalA && $totalC > $totalB && $totalC > $totalD) {
                  echo '<div class="quiz-overlay result maiden"></div><div class="results-text"><p class="you-chose">You Scored:</p><img src="../imgs/maiden.jpg" alt="Iron Maiden" class="results-img" /><div class="results test-results2"><p class="score">Iron Maiden</p><p class="score-details">Iron Maiden was one of the first bands to play with extreme speed and precision, and were forerunners of speed and thrash metal. Their mascot, Eddie, is another part of their appeal. Be aure to check out these songs: Running Free, Number of the Beast, The Prisoner, Run To The Hills, The Trooper, 2 Minutes To Midnight, Deja Vu, Fear Of The Dark.<p></p><a id="replay" class="take-quiz-btn" href="/test.php">Play Again</a></div>';
            }
            elseif ($totalD > $totalA && $totalD > $totalB && $totalD > $totalC) {
                  echo '<div class="quiz-overlay result dio"></div><div class="results-text"><p class="you-chose">You Scored:</p><img src="../imgs/rjd.jpg" alt="Ronnie James Dio" class="results-img" /><div class="results test-results2"><p class="score">Ronnie James Dio</p><p class="score-details">Ronnie James Dio possessed one of the most powerful voices in rock history. He sang for Rainbow and Black Sabbath before forming his own band, Dio. Noteworthy songs to check out include: Heaven and Hell, Neon Nights, The Mob Rules, Holy Diver, Rainbow in The Dark, Don’t Talk To Strangers, The Last In Line, I, The Devil Cried.</p><a id="replay" class="take-quiz-btn" href="test.php">Play Again</a></div>';
            }   
        ?>     
                </div>
            </div>


/* CSS Part Three */
#replay {
  display: block;
  height: 46px;
  line-height: 46px;
  margin: 20px 0 0 0;
  padding: 0;
  text-align: center;
  text-decoration: none;
}
.results-img {
  border: 4px solid #ebe9e6;
  left: -25px;
  position: absolute;
  top: 8px;
  width: 208px;
}
.test-results2 {
  color: #fff;
  font-size: 15px;
  line-height: 21px;
  text-shadow: 1px 1px rgba(2,3,5,.666);
}
.test-results2 .score {
  color: #678792; 
  font-size: 22px; 
  line-height: 30px; 
  margin-bottom: 4px;
  text-transform: uppercase;
}
.results-overlay {
  background-color: transparent;
  margin: 42px 0 0 65px;
  max-height: 325px; 
  position: relative;
  width: 510px;
}
.results-overlay .quiz-overlay {
  left: -41px;
  top: -7px;
}
.results-text {
  padding: 5px 35px 30px 215px; 
}
.score-details {
  font-size: 12px; 
  line-height: 19px; 
}
.score-details-sm {
  font-size: 12px;
  line-height: 19px;
}
.result {
  height: 325px;
}
.priest {
  background: url(../imgs/priest-bg.jpg) no-repeat;
}
.megadeth {
  background: url(../imgs/megadeth-bg.jpg) no-repeat;
}
.maiden {
  background: url(../imgs/maiden-bg.jpg) no-repeat;
}
.dio {
  background: url(../imgs/dio-bg.jpg) no-repeat;
}

At the end, there is a simple JavaScript modal that displays the embed code when the appropriate button at the top right of the screen is clicked. Note this is a button element made to resemble a text link.


<p class="embed"><button class="embed-btn" onclick="modalshow()">Embed This Quiz</button></p>
    <div id="modalbg"></div>
    <div id="modalwindow">
        <p id="modalmsg">Copy the code below to embed it into your own website.</p>
        <textarea class="c-p"><iframe src="http://metalquiz.lockedownseo.com/" height="450" width="600"></iframe></textarea>
        <button class="close-btn" onclick="modalhide()">Close</button>
    </div>
</body>
</html>


/* CSS Part Four */
.embed {
  font-size: 14px;
  position: absolute;
  right: 26px; 
  text-shadow: 1px 1px #131313;
  top: 8px; 
}
#modalbg {
  background: #333; 
  display: none;
  height: 100%;  
  left: 0; 
  opacity: .4; 
  position: fixed; 
  top: 0;
  width: 100%;
  z-index: 9;
}
#modalwindow {
  background: rgba(255,255,255,.95); 
  border: 3px outset #ccc; 
  display: none; 
  height: 254px; 
  left: 25px;
  padding: 32px; 
  position: absolute; 
  top: 35px;
  width: 480px;
  z-index:10;
}
#modalmsg {
  color: #222;
  text-align: center; 
}
.embed-btn {
  background-color: transparent;
  font-size: 14px;
}
textarea.c-p {
  display: block;
  height: 50px;
  margin: 25px auto;
  width: 420px;
}
.close-btn {
  display: block;
  margin: 70px auto 0; 
  padding: 12px 24px;
}

Additional Notes

If you Right-Click > View Source on the actual iframe or subdomain where the quiz is located, you’ll notice most of the code is minified for the sake of speed. If you want to analyze the regular the source code for this project, be sure to take a look at the GitHub repo.

Much thanks to Chris Coyier and CSS-Tricks for giving me an idea of how to get this started.

I’d love to see some quizzes that you have put together yourselves. Post your links in the comments below!