Day 15: Q&A on WordPress

What is Texonomy

A taxonomy is a way to classify and organize content. It allows you to group different content types, such as posts and custom post types, into categories or tags. Taxonomies provide a flexible way to organize and structure your content.

Default Taxonomies

The default taxonomies in WordPress are:

  • categories: a hierarchical taxonomy that organizes content in the post Post Type
  • tags: a non-hierarchical taxonomy that organizes content in the post Post Type
  • post formats: a method for creating formats for your posts. You can learn more about these on the Post Formats page.

Database Schema

Taxonomies and terms are stored in the following database tables:

  • wp_terms – stores all of the terms
  • wp_term_taxonomy – places the term in a taxonomy
  • wp_term_relationships – relates the taxonomy to an object (for example, category to post)

Templates

WordPress offers several different hierarchies of templates for categories, tags, or custom taxonomies. By default, this page is generated using the index.php template file. You can create optional template files to override and refine the index.php template files.

Page Templates

Page templates are a specific type of template file that can be applied to a specific page or groups of pages.

Since a page template is a specific type of template file, here are some distinguishing features of page templates:

  • Page templates are used to change the look and feel of a page.
  • A page template can be applied to a single page, a page section, or a class of pages.
  • Page templates generally have a high level of specificity, targeting an individual page or group of pages. For example, a page template named page-about.php is more specific than the template files page.php or index.php as it will only affect a page with the slug of “about.”
  • If a page template has a template name, WordPress users editing the page have control over what template will be used to render the page.

Classic Themes vs Block Theme

  1. Normal Themes (Classic Themes):
    • Structure: Traditional or “normal” themes in WordPress are structured around templates, which include files like header.php, footer.php, single.php, etc. These themes typically use PHP and HTML to define the structure and presentation of the website.
    • Content Editing: Content within these themes is usually entered and edited through the classic WordPress editor, which primarily relies on a content area and custom fields.
    • Customization: Customization options might vary, and additional customization is often done through theme options or custom CSS.
  2. Block Themes:
    • Structure: Block themes are designed to work seamlessly with the WordPress block editor (Gutenberg). Instead of relying heavily on traditional templates, they embrace a more modular approach where each piece of content can be a block.
    • Content Editing: Content creation and editing are done using the block editor, allowing users to create complex layouts using a variety of blocks for text, images, galleries, embeds, etc.
    • Customization: Customization is often more dynamic and visually intuitive, as users can interact with blocks directly. Block themes may come with additional features and styles tailored for use with blocks.

Leave a Reply

Your email address will not be published. Required fields are marked *