User Tools

Site Tools


docs:theme_development:custom_post_types

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docs:theme_development:custom_post_types [2025/10/07 20:03] – created - external edit 127.0.0.1docs:theme_development:custom_post_types [2026/04/12 11:12] (current) – [Practical Example] alice
Line 9: Line 9:
 Custom Post Types can be used in conjunction with the META post option to create advanced features on your basalt-ng website. Custom Post Types can be used in conjunction with the META post option to create advanced features on your basalt-ng website.
  
-=== Custom Post Type objects ===+===== Custom Post Type objects =====
 Each custom post type object in the site.json file has three properties. Each custom post type object in the site.json file has three properties.
  
Line 18: Line 18:
 The "archive_name" property is used for the friendly, human readable name for the archive page. The "archive_name" property is used for the friendly, human readable name for the archive page.
  
-=== Example site.json post types list ===+===== Example site.json post types list =====
 <code> <code>
 "custom_post_types": [ "custom_post_types": [
Line 29: Line 29:
 </code> </code>
  
-=== Using Custom Post Types ===+===== Using Custom Post Types =====
 To make use of custom post types for advanced features, a theme can use the "ssg_post_type" variable to determine if a custom post type is in use, and then using, for example, information stored in the post meta, render a different template that is more useful for the kind of information being displayed. To make use of custom post types for advanced features, a theme can use the "ssg_post_type" variable to determine if a custom post type is in use, and then using, for example, information stored in the post meta, render a different template that is more useful for the kind of information being displayed.
  
-==== Practical Example ====+===== Practical Example =====
 Lets say you want to store cooking recipes on your website. All recipes you store may have several things in common, lets say they all have: time to cook, a picture of the result, servings count and a flag saying if it's vegan or not. Lets say you want to store cooking recipes on your website. All recipes you store may have several things in common, lets say they all have: time to cook, a picture of the result, servings count and a flag saying if it's vegan or not.
  
docs/theme_development/custom_post_types.1759867418.txt.gz · Last modified: by 127.0.0.1