WEB170 » 10) Create a Pull-Quote for Your Site Using Custom Fields
Let’s say… I want to put a quote in my sidebar on my pages. But, I only want to put the quote in the sidebar if one exists. How would I do that? Use Custom Fields in your WordPress Site!
- Go to your “About” page and set up a custom field…
- First, if you don’t see your custom fields, go to your screen options and show them on your screen.
- Once you have turned them on… 1) fill in the name filed, 2) fill in the value field and 3) click add custom field.
- In your sidebar.php file, use an “if” statement to ask is the key exists using the Get Post Meta function.
- Write the markup to display your quote and place the value of custom filed’s key in an element.
- Give your quote a bit of style to make it look nice.
- I will check your Protosite’s “View” and “Code” links from your Client Staging Area according to the class Schedule (Spring) to review and grade.