Week Ten (MGDP2060)

From Wiki @ Karl Jones dot com
Revision as of 13:30, 5 November 2015 by Karl Jones (Talk | contribs) (wordpress.htcwebcreative.com)

Jump to: navigation, search

This article lists topics for week ten of Web Design and Development III (MGDP2060).

wordpress.htcwebcreative.com

A class version of WordPress is now viewable online here:

Wiki page from Dreamhost about configuring WordPress:

Simple custom theme

Last week, we created a simple custom theme.

Review:

  • ...

Theme development using multiple theme folders

When creating a custom theme, you can structure your work work as several different custom themes, each representing a different stage in the development of your final theme.

That way, you can look back on previous stages of development, comparing your current theme with earlier versions.

This is often helpful, for novice and experienced developers alike.

If something goes wrong with your current version, you can examine the previous version, figure out how to fix your current version. Previous versions are also useful as a source of code samples which can be copied-and-pasted.

Creating a new version is easy:

  • Create a copy of the current theme folder, with a different folder name
    • Pick folder names that indicate version, e.g. MyTheme1, MyTheme2,
  • In the copy, in style.css, change the Theme Name.

One alternative is to keep modifying one custom theme until it is complete.

  • What other alternatives might you consider?

WordPress CSS

As we saw last week, you can hard-code links style directly into your theme (in header.php).

Hard-coding is a hack -- a temporary solution, in this case as a classroom example, to demonstrate how WordPress works.

The proper solution is to do it the WordPress way:

  • In style.css
  • In other external style sheet(s), the WordPress way

style.css

Every theme must have a style.css file.

WordPress uses this style.css to identify the name of the theme.

style.css can also contain CSS rules, although this is not required.

index.php

Every theme must have a file named index.php.

index.php is a Template (WordPress) template file.

Other template files are optional. But every theme must have index.php.

Think of index.php as the "Home page" -- and every other page -- for your WordPress site.

Sub-templates: header.php and footer.php

Most themes use a "sub-template" file named header.php, and another named footer.php.

Template files such as index.php incorporate the sub-templates into their own template using the include() statement.

sidebar.php is another commonly used sub-template.

Using style.css for style rules

...

Other external style sheets

...

Terminology

See also