Categories
WordPress WordPress Templates

WordPress Theme Exercise Solution: Metonymic Content Template-Part

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 […]

Categories
WordPress WordPress Templates

WordPress Theme Exercise Solution: Metonymic Front Page Sectioning

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 […]

Categories
WordPress WordPress Templates

WordPress Theme Exercise Solution: Metonymic Content Generation

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. […]

Categories
WordPress WordPress Templates

WordPress Theme Exercise: Metonymic

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 […]

Categories
WordPress WordPress Templates

WordPress Templates Exercise: I Heart Cities, Updated

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 […]

Categories
WordPress WordPress Templates

WordPress: Film Festival Site: JavaScript

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. […]

Categories
WordPress Templates

WordPress Bare Bones Theming Exercise: Get Template Part & The WP Template Hierarchy

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 […]

Categories
WordPress Templates

WordPress Templating: WordPress Methods for Data Security

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 […]

Categories
WordPress WordPress Templates

Underscores Menu Exercise pt 3: Enqueuing Scripts

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 […]

Categories
WordPress Templates

WordPress Bare Bones Theming Exercise: Common Template Tags & Get Template Part

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, […]