Child Post Example
This post has a special post type called "Child Post". This allowed to specify a parent post ID. Consequently, this child post is linked to: Another Custom Fields Example (http://kylemcnatt.com/index.php/a/another-custom-fields-example).
This also allows us to access the custom fields of the parent post:
Image 1 | |
---|---|
First numeric field | 123.45 |
First string field | abcdef |
Second numeric field | 456 |
Multiline HTML field | This is an HTML field. |
Multiline plain text field | This is a sample text field. It can have multiple lines. This is an extra line. |
URL field | http://b2evolution.net/ |
USD Price | $ 17.50 |
EUR Price | 14.95 € |
Checkmark field | n/a |
Numeric Average | 289.725 |
It is also possible to selectively display only a couple of these fields:
First numeric field | 123.45 |
---|---|
First string field | abcdef |
Second numeric field | 456 |
Finally, we can also display just the value of a specific field, like this: abcdef.
We can also reference fields of any other post like this: abcdef or like this: abcdef.
It is also possible to create links using a custom field URL from the parent post: Click me!
Replicated fields
By using the same field names, it is also possible to automatically replicate some fields from parent to child (recursively).
This child post has the following fields which automatically replicate from its parent:
Another way to show this, is to use b2evolution's `` short tag:
Child Post Example | Another Custom Fields Example | |
---|---|---|
Image 1 | ||
First numeric field | 123 | 123.45 |
First string field | abc | abcdef |
Checkmark field | n/a | |
Second numeric field | 456 | |
Multiline HTML field | This is an HTML field. | |
Multiline plain text field | This is a sample text field. It can have multiple lines. This is an extra line. | |
URL field | http://b2evolution.net/ | |
USD Price | $ 17.50 | |
EUR Price | 14.95 € | |
Numeric Average | 289.725 |