Week Eleven Exercises (MGDP2060)
This article contains exercises for Week Eleven of Web Design and Development III (MGDP2060).
Contents
Create template single-product.php
In your custom PinBlack theme, copy the single.php file, and save the copy as single-product.php.
Remove the pinblack_content_nav() code.
Modify the get_template_part() code.
Create template content-single-product.php
Copy the content-single.php file, and save the copy as content-single-product.php.
Remove the date and author information.
Optional, your choice: modify or remove the category and tag information.
Modify the Products custom post type to use custom fields
In your functions.php file, modify the definition of the Product custom post type, so Products works with custom fields.
Advanced custom fields plugin
Install and activate the Advanced Custom Fields plugin.
Create a custom field name "Price".
Add price information to your various products.
- Leave at least one item with no price
In your content-single-product.php file, add PHP code to display prices, with dollar signs.
- If product has no price, do not display dollar sign.
Display featured image
Modify your content-single-product.php file so it displays featured images.