Week Nine (MGDP2060)
This article lists topics for Week Nine of Web Design and Development III (MGDP2060).
Contents
Anecdote summary and followup
Summary: Avoid the Yay-Oops cycle
- "Yay! Success!" followed by "Oops, another bug!", in a vicious Yay-Oops cycle.
Moral of the story #1: Manage expectations
- This is a management skill, necessary for managers, useful for anyone.
Followup:
- Everything is cool, my client is happy.
Moral of the story #2: Problem solving calls for predicting the future
Technology involves a lot of problem solving, and it typically involves new problems, requiring knowledge and skills which you do not yet have.
Perhaps you can acquire the knowledge, acquire the skills, and solve the problem.
- Or, failing that, perhaps you can find a workaround -- an alternate solution -- sometimes, the solution you were looking for in the first place.
Ask yourself such questions as:
- Can I solve this problem?
- What do I not know? and, Can I learn what I do not know, in a timely manner?
These are preliminary questions regarding your relationship to the problem. And these questions are predictions, or guesses, or estimates.
You are predicting the future:
- I believe I can learn the knowledge, acquire the skills, solve the problem.
- It will take me from X units to Y units of time/money/energy.
- I base my estimates -- my guesses -- my predictions about the future -- on:
- Past experience: I have solved similar problems before.
- Intuition: it's a feeling, I just know I can do this.
WordPress localhost
Review Wordpress and localhost.
WordPress custom themes
Each theme is a "custom" theme, in the sense that someone made that theme.
Themes that ship with WordPress are not usually referred to as "custom", nor are theme that you download from the WordPress theme library.
A "child theme" is a kind of custom theme, based on another theme (the "parent theme"). Any theme can be a parent theme, there is nothing special about a parent theme, the parent theme does not change or do anything.
The usual meaning of "custom theme" is a theme you built yourself, from scratch.
Custom theme structure
All themes have these basics:
- Theme folder
- style.css
- index.php
Themes usually have these files as well:
- header.php
- footer.php
Theme folder
- Folder must have unique folder name
- Folder must appear here:
style.css
...
index.php
...
header.php
Here is a simple header:
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <title><?php wp_title(); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> </head>
Note the blocks of PHP code, for example inside the title element:
<title><?php wp_title(); ?></title>
Source: Document Head (header.php)
...
Links
See:
- https://codex.wordpress.org/Site_Design_and_Layout
- https://codex.wordpress.org/Theme_Development
- https://codex.wordpress.org/Stepping_Into_Templates
- https://codex.wordpress.org/Designing_Headers
- https://codex.wordpress.org/Finding_Your_CSS_Styles
- https://codex.wordpress.org/Custom_Post_Types
Bootstrap starter theme:
Exercise
Work on your Custom Theme. Create:
- Folder for your theme
- styles.css
- index.php
- header.php
- footer.php
You will continue to build up your theme over the next several class sessions.