Custom field – add text, icon, HTML, etc. before and after the value

Content Views Pro helps you to show name, value of custom field easily.
To add custom icon, text, etc. before and after the field’s value, you can use one of 2 following solutions:

Add simple icon, text

Please add this code to Custom CSS field in Content Views >> Settings page:

.pt-cv-custom-fields[class*="FIELD_NAME"] {
    display: block !important;
}
.pt-cv-custom-fields[class*="FIELD_NAME"]:before {
    display: block;
    content: 'Your text here';
}
.pt-cv-custom-fields[class*="FIELD_NAME"]:after {
    display: block;
    content: 'Your text here';
}

Add complex HTML

Please add this code to file functions.php in the directory of your active theme:

// CVPro - Prepend prefix for custom field
add_filter( 'pt_cv_ctf_value', 'cvp_theme_ctf_value', 100, 3 );
function cvp_theme_ctf_value( $value, $key, $post ) {	
	if ( $key === 'FIELD_NAME' ) {
		$value = 'YOUR CUSTOM HTML' . $value . 'YOUR CUSTOM HTML';
	}
	
	return $value;
}

For both cases, please replace FIELD_NAME with name of your custom field.

Best regards,