Time for action—adding the code to set our width correctly
Let's add the code we need. Perform the following steps for doing so:
1. Navigate to the WordPress's Editor, or open
header.php
in your preferred text editor—whichever works for you.2. Open
header.php
.3. In the
<head>
section, insert the following line of code:<meta name="viewport" content="width=device-width">
If you're wondering where to add it, a good place is after any other
<meta>
tags. Don't add it right before the closing</head>
tag or it may interfere with other code that's placed there.4. Save the file (or click on Update File in the WordPress Editor).
What just happened?
This code will ensure that our site works correctly on mobile devices. We won't be able to see what this code does just yet, but believe me, it's essential.