Difference between revisions of "Week Ten (MGDP2060)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Adding a Category Description)
Line 19: Line 19:
 
== Adding a Category Description ==
 
== Adding a Category Description ==
  
You can add a customized description  
+
You can add a customized description for any Category using the [[WordPress Dashboard]].
 +
 
 +
Some Themes do not display the description.  You must edit the Template file(s) yourself.
 +
 
 +
== Finding the Right Template File ==
 +
 
 +
Hierarchy of Template files relating to Categories:
 +
 
 +
* <code>category-slug.php</code>
 +
* <code>category-id.php</code>
 +
* <code>category.php</code>
 +
* <code>archive.php</code>
 +
* <code>index.php</code>
 +
 
 +
See [[WordPress Category Archive]] and [[WordPress Template hierarchy]].
 +
 
 +
== Some Themes don't have category.php ==
 +
 
 +
Many Themes have a <code>category.php</code> file, but some don't.
 +
 
 +
In a Theme without <code>category.php</code>, the <code>archive.php</code> file may be complex, providing different output based on Category, Tag, Author, or Date.
 +
 
 +
== Make backups ==
 +
 
 +
Make backups.
 +
 
 +
== Changing a Category Page's Title ==
 +
 
 +
..
 +
 
 +
== Adding Extra Information ==
 +
 
 +
..
 +
 
 +
== Reordering Posts ==
 +
 
 +
..
 +
 
 +
== Removing Post Footers ==
 +
 
 +
..
 +
 
 +
== Different Category Pages for Different Categories ==
 +
 
 +
..
 +
 
 +
== Building a Better Home Page ==
 +
 
 +
..
 +
 
 +
== Cleaning Out the Template ==
 +
 
 +
..
 +
 
 +
== Adding Text ==
 +
 
 +
..
 +
 
 +
== Creating Links ==
 +
 
 +
..
 +
 
 +
== The Multi-Column Effect ==
 +
 
 +
..
 +
 
 +
== Comparing get_posts() and query_posts() ==
 +
 
 +
..
 +
 
 +
== Extracting information from a Post ==
 +
 
 +
..
 +
 
 +
== Making a Smarter Product Page ==
 +
 
 +
..
 +
 
 +
== Highlighting Products on Sale ==
 +
 
 +
..
 +
 
 +
== Cleaning Out the Templates (536) ==
 +
 
 +
..
 +
 
 +
== Creating single-product.php (537) ==
 +
 
 +
..
 +
 
 +
== Creating content-single-product.php ==
 +
 
 +
..
  
 
== Adding a Category Description ==
 
== Adding a Category Description ==

Revision as of 19:09, 1 November 2016

This article lists topics for Week Ten of Web Design and Development III (MGDP2060).

See also Week Nine and Week Eleven.

Categories

The textbook example expects you to create three categories, each representing a product line:

  • Sofas
  • Chairs
  • Tables

Creating Custom Category Pages

A Custom Category Page is a Category Archive Page) which displays Posts which belong a specific WordPress Category.

This is useful when working with Custom Post Types. Custom post types do not display in for example, the "Products" custom post type has categories for product lines such as Sofas.

Adding a Category Description

You can add a customized description for any Category using the WordPress Dashboard.

Some Themes do not display the description. You must edit the Template file(s) yourself.

Finding the Right Template File

Hierarchy of Template files relating to Categories:

  • category-slug.php
  • category-id.php
  • category.php
  • archive.php
  • index.php

See WordPress Category Archive and WordPress Template hierarchy.

Some Themes don't have category.php

Many Themes have a category.php file, but some don't.

In a Theme without category.php, the archive.php file may be complex, providing different output based on Category, Tag, Author, or Date.

Make backups

Make backups.

Changing a Category Page's Title

..

Adding Extra Information

..

Reordering Posts

..

Removing Post Footers

..

Different Category Pages for Different Categories

..

Building a Better Home Page

..

Cleaning Out the Template

..

Adding Text

..

Creating Links

..

The Multi-Column Effect

..

Comparing get_posts() and query_posts()

..

Extracting information from a Post

..

Making a Smarter Product Page

..

Highlighting Products on Sale

..

Cleaning Out the Templates (536)

..

Creating single-product.php (537)

..

Creating content-single-product.php

..

Adding a Category Description

Topic summary

Exercises

See Week Ten Exercises (MGDP2060).