|
Relationship between two custom post types
Started by: Frank Hackenbuchner
in: Toolset Professional Support
Quick solution available
|
|
2 |
5 |
7 years ago
Frank Hackenbuchner
|
|
Child post fields are shown with types_child_fields but not with get_posts
Started by: lemoigneL
in: Toolset Professional Support
Quick solution available
Problem: I have some custom code that uses types_child_posts to get a list of child posts. Then I am able to use the $post->fields['field-slug'] syntax to display custom post fields from the child post. However, if I use the native WordPress get_posts function to get the child posts, I am not able to use the same $post->fields['field-slug'] syntax to get information about a custom field.
Solution: The native WordPress get_posts function does not return information about custom fields, so you must use get_post_meta to retrieve custom field information about each post returned by get_posts.
$date = get_post_meta(get_the_ID(), 'wpcf-date', true);
echo date('l jS \of F Y h:i:s A', $date);
Relevant Documentation:
https://developer.wordpress.org/reference/functions/get_posts/
https://developer.wordpress.org/reference/functions/get_post_meta/
|
|
2 |
5 |
7 years ago
lemoigneL
|
|
Child posts disappear when saving parent posts
Started by: mariaA-6
in: Toolset Professional Support
Quick solution available
Problem:
Saving a parent post resets all of the child posts so that they become parent posts.
Solution:
The issue arises from a conflict with the Post Type Switcher plugin and disappears when that plugin is disabled.
|
|
2 |
3 |
7 years ago
mariaA-6
|
|
Set a post as a child
Started by: PiotrO586
in: Toolset Professional Support
Quick solution available
|
|
2 |
7 |
7 years ago
PiotrO586
|