Yes.
Category: Templates
Can I customize/edit the fields of listings?
Yes.
How can I auto-assign the first image file for a listing as the featured image whenever a directory listing is added/updated?
Use the following code:
add_action(‘drts_entity_create_post_entity_success’, ‘my_drts_entity_create_post_entity_succes’, 10, 2);
add_action(‘drts)_entity_create_post_entity_succes’, 10, 2);
function my_drts_entity_create_post_entity_succes($bundle, $entity) {
if ($bundle->type === ‘directory__listing’) {
delete_post_thumbnail($entity->getId());
if ($value = $entity->getSingleFieldValue(‘directory_photos’)) {
set_post_thumbnail($entity->getId(), $value[‘attachment_id’]);
}
}
}
Can one edit the template used for individual listings, e.g. to avoid having to edit a single-xxx.php file?
This is possible using Content Types > Listing > Manage Displays but the ability to control the actual design (e.g. sidebars/page builders) is planned for 1.2.0.