Step 1:
Add this at the very bottom of your theme functions.php (take care not to leave blank lines after this):
<?php
function cust_get_custom_field_value($name) {
$getItemMeta = osc_get_item_meta();
$name = '/^'. $name . '$/';
$index = array_filter($getItemMeta, function($a) use($name) {
return preg_grep($name, $a);
});
return $getItemMeta[key($index)]['s_value'];
}
?>
Step 2:
Now in loop-grid.php and loop-search-grid.php put this where you want your custom field. Custom field name = customfield1
<?php echo cust_get_custom_field_value(customfield1); ?>
Thanks!