infoindustry

Where should I add this code? To function.php of ListingHive theme?

add_filter(
‘hivepress/v1/models/listing/fields’,
function( $fields, $listing ) {
foreach ( $fields as $name => $field ) {
if ( isset( $field[‘display_template’] ) && strpos( $field[‘display_template’], ‘%listing_url%’ ) !== false ) {
$fields[ $name ][‘display_template’] = str_replace( ‘%listing_url%’, get_permalink( $listing->get_id() ), $field[‘display_template’] );
}
}

return $fields;
},
1000,
2
);

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.