Now let’s add a couple more modifications to the content.php template part. The Meta Data If we look at the screenshots of the front page and the single view, we see that the meta information (date and author) is not needed. However, for the Opinions section of the home page, the author name and gravatar […]
Category: WordPress Templates
We ended the previous article having generated the main content for the home page of the site. However, if we inspect the code with browser developer tools, we’ll see that there’s just a ton of articles inside the .site-content MAIN element. Our next step, therefore, should be to introduce some sectioning HTML to our loop […]
This page presents a solution for WordPress Theme Exercise: Metonymic. If you want to try building the site without following step-by-step directions, consult that document. If going through these instructions, please first review the original instructions at that link. Content Generation Let’s start with the biggest task: the generation of content for the front page. […]
In this exercise, you will build two significant parts of a WordPress theme: the home page and the single post view. You may use your notes or the Internet. If this is a test, talking to anyone will result in a zero grade. Initial Setup First, please download the following: the duplicator package the screenshots […]
Initial Setup Download Duplicator Site For this exercise, please download the starter files and the screenshots collection, if I don’t distribute them in class. These are big files, so the download might be a bit longer than that for most of the files on this site. Most, but not all, of the screenshots for the […]
Now let’s wire up some JavaScript to hide the registration form and allow it be shown with the click of a button. First, make a new file called registration.js inside the js folder in your theme. When I originally wrote up this exercise, I used jQuery. These days, I would probably just use straight JavaScript. […]
This exercise continues on from Bare Bones WordPress Theming Exercise: Common Template Tags. We ended that exercise having made a template part called article-short.php. Now, duplicate that file and name it article-long.php. In that file, make two edits: first, change the_excerpt(); to the_content();. then, remove the link code around the title of the post The […]
For this demonstration, please install this duplicator archive package. Be sure to make yourself a new admin user account as part of this process. This is a variation on The Eatery exercise, with two custom post types: meal_menu and staff_member. In class, we’ll go through a few examples to show ways we can make our […]
Other Values If enqueueing scripts (or local stylesheets), it is a bit more complicated, but it’s learnable. All URLs in WordPress are absolute, not relative, so when the theme is installed at a new domain, WordPress needs to figure out the path to resources, starting with the https://domain.com/ part. If you look at the script […]
When we ended part 1 of this exercise, we saw a bunch of posts output to the screen. In this part of the exercise, we are going to edit our template files in order to grab more information from the site database and output it in appropriate places in the page generation process. Header.php First, […]